Files
TheRock/rocm-systems/projects/rccl/test/common/TestChecks.cpp
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

53 lines
1.5 KiB
C++

/*************************************************************************
* Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
*
* See LICENSE.txt for license information
************************************************************************/
/**
* @file TestChecks.cpp
* @brief Implementation file for TestChecks.hpp
*
* Provides definitions for variables used by test logging macros.
*/
#include "TestChecks.hpp"
#ifdef MPI_TESTS_ENABLED
#include <cstdlib>
#include <cstring>
// Define and initialize rcclTestDebugLevel for TEST_* macros
// This matches RCCL's debug level parsing logic from src/debug.cc
// Values correspond to ncclDebugLogLevel enum in nccl_common.h:
// - -1 = Uninitialized (treated as ERROR level)
// - 0 = NCCL_LOG_NONE
// - 1 = NCCL_LOG_VERSION
// - 2 = NCCL_LOG_WARN
// - 3 = NCCL_LOG_INFO
// - 4 = NCCL_LOG_ABORT
// - 5 = NCCL_LOG_TRACE
int rcclTestDebugLevel = []() -> int {
const char* env = std::getenv("NCCL_DEBUG");
// Default to ERROR level if not set (matches RCCL behavior)
if (!env) return -1;
// Match RCCL's case-insensitive string comparison
if (strcasecmp(env, "NONE") == 0) return 0;
if (strcasecmp(env, "VERSION") == 0) return 1;
if (strcasecmp(env, "WARN") == 0) return 2;
if (strcasecmp(env, "INFO") == 0) return 3;
if (strcasecmp(env, "ABORT") == 0) return 4;
if (strcasecmp(env, "TRACE") == 0) return 5;
// Unknown value, default to ERROR level
return -1;
}();
#endif // MPI_TESTS_ENABLED