6.37. 性能分析器控制 [已弃用]
本节介绍底层CUDA驱动应用程序编程接口的性能分析器控制功能。
Functions
- CUresult cuProfilerInitialize ( const char* configFile, const char* outputFile, CUoutput_mode outputMode )
- Initialize the profiling.
Functions
- CUresult cuProfilerInitialize ( const char* configFile, const char* outputFile, CUoutput_mode outputMode )
-
初始化性能分析。
参数
- configFile
- - Name of the config file that lists the counters/options for profiling.
- outputFile
- - Name of the outputFile where the profiling results will be stored.
- outputMode
- - outputMode, can be CU_OUT_KEY_VALUE_PAIR or CU_OUT_CSV.
已弃用
请注意,此函数已弃用,不应再使用。从CUDA 12.0开始,该函数始终返回错误代码CUDA_ERROR_NOT_SUPPORTED。
描述
通过此API,用户可以通过指定配置文件、输出文件及输出文件格式来初始化CUDA性能分析器。 该API通常用于通过循环启动内核来分析不同的计数器集合。configFile参数可用于选择性能分析选项(包括分析器计数器)。支持的性能分析器选项和计数器请参阅《Compute Command Line Profiler User Guide》。
限制:如果另一个性能分析工具已在运行(通过CUDA_ERROR_PROFILER_DISABLED返回码标识),则无法使用此API初始化CUDA性能分析器。
性能分析API的典型用法如下:
对于每组计数器/选项 { cuProfilerInitialize(); //初始化性能分析,在配置文件中设置计数器或选项 ... cuProfilerStart(); // 待分析的代码 cuProfilerStop(); ... cuProfilerStart(); // 待分析的代码 cuProfilerStop(); ... }
Note:请注意,此函数也可能返回之前异步启动的错误代码。
另请参阅: