Files
TheRock/rocm-libraries/projects/rocsparse/library/include/rocsparse-debugging.h
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

198 lines
7.6 KiB
C

/* ************************************************************************
* Copyright (C) 2025-2026 Advanced Micro Devices, Inc. All rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* ************************************************************************ */
/*! \file
* \brief rocsparse-debugging.h provides debugging functions in rocsparse
*/
#ifndef ROCSPARSE_DEBUGGING_H
#define ROCSPARSE_DEBUGGING_H
#include "rocsparse-types.h"
#include "rocsparse/rocsparse-export.h"
#ifdef __cplusplus
extern "C" {
#endif
/*! \ingroup aux_module
* \brief Enable debug kernel launch.
* \details If the debug kernel launch is enabled, then HIP errors are checked before and
* after every kernel launch.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_KERNEL_LAUNCH.
*/
ROCSPARSE_EXPORT
void rocsparse_enable_debug_kernel_launch();
/*! \ingroup aux_module
* \brief Disable debug kernel launch.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_KERNEL_LAUNCH.
*/
ROCSPARSE_EXPORT void rocsparse_disable_debug_kernel_launch();
/*! \ingroup aux_module
* \details Query whether debugging for kernel launch has been enabled. See \ref rocsparse_enable_debug_kernel_launch.
* \return 1 if enabled, 0 otherwise.
*/
ROCSPARSE_EXPORT int rocsparse_state_debug_kernel_launch();
/*! \ingroup aux_module
* \brief Enable debug arguments.
* \details If the debug arguments is enabled, then messages are displayed when errors occur during argument checking.
* It provides information to the user depending on the verbosity setup for
* \ref rocsparse_enable_debug_arguments_verbose, \ref rocsparse_disable_debug_arguments_verbose, and \ref rocsparse_state_debug_arguments_verbose.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_ARGUMENTS.
* \note This routine enables debug arguments verbose with \ref rocsparse_enable_debug_arguments_verbose.
*/
ROCSPARSE_EXPORT
void rocsparse_enable_debug_arguments();
/*! \ingroup aux_module
* \brief Disable debug arguments.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_ARGUMENTS.
* \note This routine disables debug arguments.
*/
ROCSPARSE_EXPORT
void rocsparse_disable_debug_arguments();
/*! \ingroup aux_module
* \details Query whether debugging arguments have been enabled. See \ref rocsparse_enable_debug_arguments.
* \return 1 if enabled, 0 otherwise.
*/
ROCSPARSE_EXPORT
int rocsparse_state_debug_arguments();
/*! \ingroup aux_module
* \brief Enable debug arguments verbose.
* \details If the debug arguments (verbose) is enabled, then messages are displayed when errors occur during argument checking.
* It provides information to the user depending on the verbosity setup.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_ARGUMENTS_VERBOSE.
*/
ROCSPARSE_EXPORT
void rocsparse_enable_debug_arguments_verbose();
/*! \ingroup aux_module
* \brief Disable debug arguments verbose mode.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_ARGUMENTS_VERBOSE.
*/
ROCSPARSE_EXPORT
void rocsparse_disable_debug_arguments_verbose();
/*! \ingroup aux_module
* \details Query whether debugging arguments in verbose mode has been enabled. See \ref rocsparse_enable_debug_arguments_verbose.
* \return 1 if enabled, 0 otherwise.
*/
ROCSPARSE_EXPORT
int rocsparse_state_debug_arguments_verbose();
/*! \ingroup aux_module
* \brief Enable debug.
* \details If the debug is enabled, then code traces are generated when unsuccessful status returns occur. It provides information to the user depending on the verbosity setup
* (\ref rocsparse_enable_debug_verbose, \ref rocsparse_disable_debug_verbose, and \ref rocsparse_state_debug_verbose).
* \note This routine ignores the environment variable ROCSPARSE_DEBUG.
* \note \ref rocsparse_enable_debug_verbose and \ref rocsparse_enable_debug_arguments are called.
*/
ROCSPARSE_EXPORT
void rocsparse_enable_debug();
/*! \ingroup aux_module
* \brief Disable debug.
* \note This routine disables debug arguments with \ref rocsparse_disable_debug_arguments.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG.
*/
ROCSPARSE_EXPORT
void rocsparse_disable_debug();
/*! \ingroup aux_module
* \details Query whether debug has been enabled. See \ref rocsparse_enable_debug.
* \return 1 if enabled, 0 otherwise.
*/
ROCSPARSE_EXPORT
int rocsparse_state_debug();
/*! \ingroup aux_module
* \brief Enable debug warnings
* \details When the debug warnings are enabled, some specific warnings are printed during execution.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_WARNINGS.
*/
ROCSPARSE_EXPORT
void rocsparse_enable_debug_warnings();
/*! \ingroup aux_module
* \brief Disable debug warnings
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_WARNINGS.
*/
ROCSPARSE_EXPORT
void rocsparse_disable_debug_warnings();
/*! \ingroup aux_module
* \brief Enable debug verbose.
* \details Debug in verbose mode displays a stack of code traces showing where the code handles an unsuccessful status.
* \note This routine enables debug arguments in verbose mode with \ref rocsparse_enable_debug_arguments_verbose.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_VERBOSE.
*/
ROCSPARSE_EXPORT
void rocsparse_enable_debug_verbose();
/*! \ingroup aux_module
* \brief Disable debug verbose.
* \note This routine disables debug arguments verbose with \ref rocsparse_disable_debug_arguments.
* \note This routine ignores the environment variable \p ROCSPARSE_DEBUG_VERBOSE.
*/
ROCSPARSE_EXPORT
void rocsparse_disable_debug_verbose();
/*! \ingroup aux_module
* \details Query whether debug has been enabled in verbose mode. See \ref rocsparse_enable_debug_verbose.
* \return 1 if enabled, 0 otherwise.
*/
ROCSPARSE_EXPORT
int rocsparse_state_debug_verbose();
/*! \ingroup aux_module
* \brief Enable debug to force host asserts.
* \details Debug for force host assert forces the evaluation of asserts on the host when the compiler directive \p NDEBUG is used.
*/
ROCSPARSE_EXPORT
void rocsparse_enable_debug_force_host_assert();
/*! \ingroup aux_module
* \brief Disable debug to force host asserts.
*/
ROCSPARSE_EXPORT
void rocsparse_disable_debug_force_host_assert();
/*! \ingroup aux_module
* \details Query whether the debug command to force host asserts has been enabled. See \ref rocsparse_enable_debug_force_host_assert.
* \return 1 if enabled, 0 otherwise.
*/
ROCSPARSE_EXPORT
int rocsparse_state_debug_force_host_assert();
#ifdef __cplusplus
}
#endif
#include "internal/debugging/rocsparse_hip_debug.h"
#endif /* ROCSPARSE_DEBUGGING_H */