Logging#
Three different environment variables can be set to enable logging in rocSPARSE: ROCSPARSE_LAYER
, ROCSPARSE_LOG_TRACE_PATH
, ROCSPARSE_LOG_BENCH_PATH
and ROCSPARSE_LOG_DEBUG_PATH
.
ROCSPARSE_LAYER
is a bit mask, where several logging modes (rocsparse_layer_mode) can be combined as follows:
|
logging is disabled. |
|
trace logging is enabled. |
|
bench logging is enabled. |
|
trace logging and bench logging is enabled. |
|
debug logging is enabled. |
|
trace logging and debug logging is enabled. |
|
bench logging and debug logging is enabled. |
|
trace logging and bench logging and debug logging is enabled. |
When logging is enabled, each rocSPARSE function call will write the function name as well as function arguments to the logging stream. The default logging stream is stderr
.
If the user sets the environment variable ROCSPARSE_LOG_TRACE_PATH
to the full path name for a file, the file is opened and trace logging is streamed to that file. If the user sets the environment variable ROCSPARSE_LOG_BENCH_PATH
to the full path name for a file, the file is opened and bench logging is streamed to that file. If the file cannot be opened, logging output is stream to stderr
.
Note that performance will degrade when logging is enabled. By default, the environment variable ROCSPARSE_LAYER
is unset and logging is disabled.