6.35. Profiler 控制

本节介绍 CUDA 运行时应用程序编程接口的 profiler 控制功能。

函数

__host__cudaError_t cudaProfilerStart ( void )
启用 profiling。
__host__cudaError_t cudaProfilerStop ( void )
禁用 profiling。

函数

__host__cudaError_t cudaProfilerStart ( void )
启用 profiling。
返回值

cudaSuccess

描述

为当前上下文启用活动 profiling 工具的 profile 收集。如果 profiling 已启用,则 cudaProfilerStart() 不会产生任何影响。

cudaProfilerStart 和 cudaProfilerStop API 用于以编程方式控制 profiling 粒度,从而允许仅对选择的代码段进行 profiling。

注意

请注意,此函数也可能返回先前异步启动的错误代码。

另请参阅

cudaProfilerStop, cuProfilerStart

__host__cudaError_t cudaProfilerStop ( void )
禁用 profiling。
返回值

cudaSuccess

描述

为当前上下文禁用活动 profiling 工具的 profile 收集。如果 profiling 已禁用,则 cudaProfilerStop() 不会产生任何影响。

cudaProfilerStart 和 cudaProfilerStop API 用于以编程方式控制 profiling 粒度,从而允许仅对选择的代码段进行 profiling。

注意

请注意,此函数也可能返回先前异步启动的错误代码。

另请参阅

cudaProfilerStart, cuProfilerStop