profiling - sycl::info::event_profiling 中的 command_submit 提交整个代码还是仅提交并行?
问题描述
我尝试分析我的功能在设备上的执行时间。我读了这个链接: https : //docs.oneapi.com/versions/latest/dpcpp/iface/event.html 但我没有在文档中找到任何关于 sycl::info::event_profiling 的信息,这让我理解它们完全对应的是什么。我的意思是,command_start、command_end、command_submit。例如:这是我的代码的一部分,内核,
auto event = gpuQueue.submit([&](sycl::handler &h) {
//local copy of fun
auto f = fun;
sycl::accessor in_accessor(in_buffer, h, sycl::read_only);
sycl::accessor out_accessor(out_buffer, h, sycl::write_only);
h.parallel_for(n_item, [=](sycl::id<1> index) {
out_accessor[index] = f(in_accessor[index]);
});
});
event.wait();
auto end_overall = std::chrono::system_clock::now();
cl_ulong submit_time = event.template get_profiling_info<
cl::sycl::info::event_profiling::command_submit>();
cl_ulong start_time = event.template get_profiling_info<
cl::sycl::info::event_profiling::command_start>();
cl_ulong end_time = event.template get_profiling_info<
cl::sycl::info::event_profiling::command_end>();
我想了解 cl::sycl::info::event_profiling::command_submit,提交整个代码还是只提交并行?
解决方案
SYCL 2020 规范更清楚一点:
command_submit
是命令组提交到 SYCL 运行时的时间戳。command_start
是实际并行开始的时间戳command_end
是完成并行的时间戳
因此,您在设备中的内核执行时间是command_start
- command_end
,而命令组的总处理时间(即潜在的副本、运行时开销等)是command_submit
- command_end
。
推荐阅读
- matlab - 如何编写运行分区的这个方程?
- java - 如何在不使用任何整数变量的情况下在按钮单击时在 Textview 上应用 If Else?
- solr - 向 Carrot2 WAR 文件添加身份验证
- android - 将枚举与数字一起使用
- python - openCV的conda错误-找不到符号
- amazon-web-services - 将 Amazon S3 用于客户图像和缩略图
- powershell - PowerShell - 如果是特定字符,则删除第一个字符
- api - 使用 GMail API 如何查看帐户上是否有现有手表?
- php - 为什么我不能将当前日期保存在 mysql 的数据库中?
- oracle-adf - 如何通过托管 bean 以编程方式提交?