|
|
|
@ -22,21 +22,21 @@ def cuda_profiler(output_file, output_mode=None, config=None):
|
|
|
|
|
`output_file` with Key-Value pair format or Comma separated values format.
|
|
|
|
|
The user can set the output mode by `output_mode` argument and set the
|
|
|
|
|
counters/options for profiling by `config` argument. The default config
|
|
|
|
|
caontains 'gpustarttimestamp', 'gpustarttimestamp', 'gridsize3d',
|
|
|
|
|
'threadblocksize', 'streamid', 'enableonstart 0', 'conckerneltrace'.
|
|
|
|
|
is ['gpustarttimestamp', 'gpustarttimestamp', 'gridsize3d',
|
|
|
|
|
'threadblocksize', 'streamid', 'enableonstart 0', 'conckerneltrace'].
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
output_file (string) : The output file name, the result will be
|
|
|
|
|
written into this file.
|
|
|
|
|
output_mode (string) : The output mode has Key-Value pair format and
|
|
|
|
|
Comma separated values format. It should be 'kv' or 'csv'.
|
|
|
|
|
Comma separated values format. It should be 'kvp' or 'csv'.
|
|
|
|
|
config (string) : The profiler options and counters can refer to
|
|
|
|
|
"Compute Command Line Profiler User Guide".
|
|
|
|
|
"""
|
|
|
|
|
if output_mode is None:
|
|
|
|
|
output_mode = 'csv'
|
|
|
|
|
if output_mode not in ['kv', 'csv']:
|
|
|
|
|
raise ValueError("The output mode must be 'key-value' or 'csv'.")
|
|
|
|
|
if output_mode not in ['kvp', 'csv']:
|
|
|
|
|
raise ValueError("The output mode must be 'kvp' or 'csv'.")
|
|
|
|
|
config = NVPROF_CONFIG if config is None else config
|
|
|
|
|
core.nvprof_init(output_file, output_mode, config)
|
|
|
|
|
# Enables profiler collection by the active CUDA profiling tool.
|
|
|
|
|