3.2. Logging Functions¶
These are functions that enable and control rocSOLVER’s Multi-level Logging capabilities. Functions are divided in two categories:
Logging set-up and tear-down functions. Used to initialize and terminate the logging.
Profile logging functions. Provide functionality for the profile logging mode.
3.2.1. Logging set-up and tear-down¶
List of logging initialization functions
rocsolver_log_begin()¶
-
rocblas_status
rocsolver_log_begin
(void)¶ LOG_BEGIN begins a rocSOLVER multi-level logging session.
Initializes the rocSOLVER logging environment with default values (no logging and one level depth). Default mode can be overridden by using the environment variables ROCSOLVER_LAYER and ROCSOLVER_LEVELS.
This function also sets the streams where the log results will be outputted. The default is STDERR for all the modes. This default can also be overridden using the environment variable ROCSOLVER_LOG_PATH, or specifically ROCSOLVER_LOG_TRACE_PATH, ROCSOLVER_LOG_BENCH_PATH, and/or ROCSOLVER_LOG_PROFILE_PATH.
rocsolver_log_end()¶
-
rocblas_status
rocsolver_log_end
(void)¶ LOG_END ends the multi-level rocSOLVER logging session.
If applicable, this function also prints the profile logging results before cleaning the logging environment.
rocsolver_log_set_layer_mode()¶
-
rocblas_status
rocsolver_log_set_layer_mode
(const rocblas_layer_mode_flags layer_mode)¶ LOG_SET_LAYER_MODE sets the logging mode for the rocSOLVER multi-level logging environment.
- Parameters
[in] layer_mode
: rocblas_layer_mode_flags.Specifies the logging mode.
rocsolver_log_set_max_levels()¶
-
rocblas_status
rocsolver_log_set_max_levels
(const rocblas_int max_levels)¶ LOG_SET_MAX_LEVELS sets the maximum trace log depth for the rocSOLVER multi-level logging environment.
- Parameters
[in] max_levels
: rocblas_int. max_levels >= 1.Specifies the maximum depth at which nested function calls will appear in the trace and profile logs.
rocsolver_log_restore_defaults()¶
-
rocblas_status
rocsolver_log_restore_defaults
(void)¶ LOG_RESTORE_DEFAULTS restores the default values of the rocSOLVER multi-level logging environment.
This function sets the logging mode and maximum trace log depth to their default values (no logging and one level depth).
3.2.2. Profile logging¶
List of profile logging functions
rocsolver_log_write_profile()¶
-
rocblas_status
rocsolver_log_write_profile
(void)¶ LOG_WRITE_PROFILE prints the profile logging results.
rocsolver_log_flush_profile()¶
-
rocblas_status
rocsolver_log_flush_profile
(void)¶ LOG_FLUSH_PROFILE prints the profile logging results and clears the profile record.