CUDA Runtime API (PDF) - v11.0.207 (older) - Last updated June 29, 2020 - Send Feedback

## 5.33. Profiler Control

This section describes the profiler control functions of the CUDA runtime application programming interface.

### Functions

__host__ ​cudaError_t cudaProfilerStart ( void )
  Enable profiling.
__host__ ​cudaError_t cudaProfilerStop ( void )
  Disable profiling.

### Functions

__host__ ​cudaError_t cudaProfilerStart ( void )
  Enable profiling.

  ###### Returns

  cudaSuccess

  ###### Description

  Enables profile collection by the active profiling tool for the current context. If profiling is already enabled, then cudaProfilerStart() has no effect.

  cudaProfilerStart and cudaProfilerStop APIs are used to programmatically control the profiling granularity by allowing profiling to be done only on selective pieces of code.

  Note:

  Note that this function may also return error codes from previous, asynchronous launches.

  See also:

  cudaProfilerInitialize, cudaProfilerStop, cuProfilerStart

__host__ ​cudaError_t cudaProfilerStop ( void )
  Disable profiling.

  ###### Returns

  cudaSuccess

  ###### Description

  Disables profile collection by the active profiling tool for the current context. If profiling is already disabled, then cudaProfilerStop() has no effect.

  cudaProfilerStart and cudaProfilerStop APIs are used to programmatically control the profiling granularity by allowing profiling to be done only on selective pieces of code.

  Note:

  Note that this function may also return error codes from previous, asynchronous launches.

  See also:

  cudaProfilerInitialize, cudaProfilerStart, cuProfilerStop