检测Thrust变换的ptx内核 [英] Detecting ptx kernel of Thrust transform

查看:116
本文介绍了检测Thrust变换的ptx内核的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的thrust :: transform调用。

I have following thrust::transform call.

my_functor *f_1 = new my_functor();
thrust::transform(data.begin(), data.end(), data.begin(),*f_1);

我想检测它在PTX文件中的相应内核。但是有许多内核在其名称中包含my_functor。

I want to detect it's corresponding kernel in PTX file. But there are many kernels containing my_functor in their mangled names.

例如 -

_ZN6thrust6system4cuda6detail6detail23launch_closure_by_valueINS2_17for_each_n_detail18for_each_n_closureINS_12zip_iteratorINS_5tupleINS_6detail15normal_iteratorINS_10device_ptrIiEEEESD_NS_9null_typeESE_SE_SE_SE_SE_SE_SE_EEEEjNS9_30device_unary_transform_functorI10my_functorEENS3_20blocked_thread_arrayEEEEEvT_

_ZN6thrust6system4cuda6detail6detail23launch_closure_by_valueINS2_17for_each_n_detail18for_each_n_closureINS_12zip_iteratorINS_5tupleINS_6detail15normal_iteratorINS_10device_ptrIiEEEESD_NS_9null_typeESE_SE_SE_SE_SE_SE_SE_EEEElNS9_30device_unary_transform_functorI10my_functorEENS3_20blocked_thread_arrayEEEEEvT_

_ZN6thrust6detail15device_functionINS0_30device_unary_transform_functorI10my_functorEEvEC1ERKS4_

哪些内核被启动,以及这些其他内核是什么?

Which kernel is launched and what are these other kernels?

推荐答案

如果使用Visual Studio,请使用Nvidia NSight Visual Studio

If you are using Visual Studio, use Nvidia NSIGHT Visual Studio Edition which comes with the CUDA Toolkit.

转到Nsight菜单,单击开始性能分析...条目。

Go to the "Nsight" menu, click on the "Start Performance Analysis..." entry.


  • 在活动类型中选择个人资料CUDA应用程序

  • 在实验设置 CUDA Source View

  • 在运行实验列表框中选择全部

  • ,然后在列表框中选择CUDA源代码视图

  • In "Activity type", select "Profile CUDA Application"
  • In "Experiment settings", tick "Collect Information for CUDA Source View"
  • Choose "All" in the "Experiments to Run" listbox
  • In "Capture Control", tick "Open Report on Stop" and select "CUDA Source View" in the listbox

然后,单击启动,等待应用程序完全执行。
您将在Nsight的控制台中看到额外的输出。

Then, click on "Launch" and wait for your application to be fully executed. You will see additional output in the console from Nsight.

执行后,将打开CUDA源代码视图窗口。
- 在查看列表框中选择源和PTX
您将能够找到源代码和生成的PTX之间的对应关系。
当您单击源代码中的一行时,PTX代码中的一行或多行将以绿色突出显示。

After the execution, the "CUDA Source View" window will open. - Select "Source and PTX" in the "View" listbox You will be able to find the correspondance between source code and generated PTX. When you click on a line in the source code, one or more lines are highlighted in green in the PTX code.

这篇关于检测Thrust变换的ptx内核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆