cuProfilerInitialize (3)
NAME
Profiler Control -Functions
CUresult cuProfilerInitialize (const char *configFile, const char *outputFile, CUoutput_mode outputMode)
Initialize the profiling.
CUresult cuProfilerStart (void)
Enable profiling.
CUresult cuProfilerStop (void)
Disable profiling.
Detailed Description
\brief profiler control functions of the low-level CUDA driver API (cudaProfiler.h)
This section describes the profiler control functions of the low-level CUDA driver application programming interface.
Function Documentation
CUresult cuProfilerInitialize (const char * configFile, const char * outputFile, CUoutput_mode outputMode)
Using this API user can initialize the CUDA profiler by specifying the configuration file, output file and output file format. This API is generally used to profile different set of counters by looping the kernel launch. The configFile parameter can be used to select profiling options including profiler counters. Refer to the 'Compute Command Line Profiler User Guide' for supported profiler options and counters.
Limitation: The CUDA profiler cannot be initialized with this API if another profiling tool is already active, as indicated by the CUDA_ERROR_PROFILER_DISABLED return code.
Typical usage of the profiling APIs is as follows:
for each set of counters/options
{
cuProfilerInitialize(); //Initialize profiling, set the counters or options in the config file
...
cuProfilerStart();
// code to be profiled
cuProfilerStop();
...
cuProfilerStart();
// code to be profiled
cuProfilerStop();
...
}
Parameters:
-
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.
Returns:
- CUDA_SUCCESS, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_PROFILER_DISABLED
Note:
- Note that this function may also return error codes from previous, asynchronous launches.
See also:
- cuProfilerStart, cuProfilerStop
CUresult cuProfilerStart (void)
Enables profile collection by the active profiling tool for the current context. If profiling is already enabled, then cuProfilerStart() has no effect.
cuProfilerStart and cuProfilerStop APIs are used to programmatically control the profiling granularity by allowing profiling to be done only on selective pieces of code.
Returns:
- CUDA_SUCCESS, CUDA_ERROR_INVALID_CONTEXT
Note:
- Note that this function may also return error codes from previous, asynchronous launches.
See also:
- cuProfilerInitialize, cuProfilerStop
CUresult cuProfilerStop (void)
Disables profile collection by the active profiling tool for the current context. If profiling is already disabled, then cuProfilerStop() has no effect.
cuProfilerStart and cuProfilerStop APIs are used to programmatically control the profiling granularity by allowing profiling to be done only on selective pieces of code.
Returns:
- CUDA_SUCCESS, CUDA_ERROR_INVALID_CONTEXT
Note:
- Note that this function may also return error codes from previous, asynchronous launches.
See also:
- cuProfilerInitialize, cuProfilerStart
Author
Generated automatically by Doxygen from the source code.