Using this API user can specify the configuration file, output file and output file format. This API is generally used to profile different set of counters/options by looping the kernel launch. configFile
parameter can be used to select profiling options including profiler counters/options. Refer the "Command Line Profiler" section in the "Compute Visual Profiler User Guide" for supported profiler options and counters.
Configurations defined initially by environment variable settings are overwritten by cuProfilerInitialize().
Limitation: Profiling APIs do not work when the application is running with any profiler tool such as Compute Visual Profiler. User must handle error CUDA_ERROR_PROFILER_DISABLED returned by profiler APIs if application is likely to be used with any profiler tool.
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_VALUE, CUDA_ERROR_PROFILER_DISABLED
- Note:
- Note that this function may also return error codes from previous, asynchronous launches.
- See also:
- cuProfilerStart, cuProfilerStop