From c8306c26b837b68aade812f08e4b7dac79c6d834 Mon Sep 17 00:00:00 2001 From: Min Zhou Date: Thu, 18 Jul 2024 03:03:15 -0400 Subject: [PATCH] Fix some misused callings to debug_warning() Debug_warning() outputs only when the expression is false. Signed-off-by: Min Zhou --- src/core/runtime/amd_gpu_agent.cpp | 2 +- src/core/runtime/runtime.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/runtime/amd_gpu_agent.cpp b/src/core/runtime/amd_gpu_agent.cpp index d7f6a4fdb..4c94282a1 100644 --- a/src/core/runtime/amd_gpu_agent.cpp +++ b/src/core/runtime/amd_gpu_agent.cpp @@ -1440,7 +1440,7 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { case HSA_AMD_AGENT_INFO_COOPERATIVE_COMPUTE_UNIT_COUNT: if (core::Runtime::runtime_singleton_->flag().coop_cu_count() && !(core::Runtime::runtime_singleton_->flag().cu_mask(enum_index_).empty())) { - debug_warning("Cooperative launch and CU masking are currently incompatible!"); + debug_warning(false && "Cooperative launch and CU masking are currently incompatible!"); *((uint32_t*)value) = 0; break; } diff --git a/src/core/runtime/runtime.cpp b/src/core/runtime/runtime.cpp index ceae7333e..d4c7c1d75 100644 --- a/src/core/runtime/runtime.cpp +++ b/src/core/runtime/runtime.cpp @@ -1838,7 +1838,7 @@ hsa_status_t Runtime::Load() { * This is not a failure, in some environments such as SRIOV, not all CPUID info is * exposed inside the guest */ - debug_warning("Parsing CPUID failed."); + debug_warning(false && "Parsing CPUID failed."); } flag_.Refresh(); @@ -1852,7 +1852,7 @@ hsa_status_t Runtime::Load() { // Setup system clock frequency for the first time. if (sys_clock_freq_ == 0) { sys_clock_freq_ = os::SystemClockFrequency(); - if (sys_clock_freq_ < 100000) debug_warning("System clock resolution is low."); + if (sys_clock_freq_ < 100000) debug_warning(false && "System clock resolution is low."); } BindErrorHandlers(); @@ -2049,7 +2049,7 @@ void Runtime::CheckVirtualMemApiSupport() { fn_amdgpu_device_get_fd = (int (*)(HsaAMDGPUDeviceHandle device_handle))dlsym(RTLD_DEFAULT, "amdgpu_device_get_fd"); if ((error = dlerror()) != NULL) { - debug_warning("amdgpu_device_get_fd not available. Please update version of libdrm"); + debug_warning(false && "amdgpu_device_get_fd not available. Please update version of libdrm"); fn_amdgpu_device_get_fd = &fn_amdgpu_device_get_fd_nosupport; } else { virtual_mem_api_supported_ = true; @@ -2074,7 +2074,7 @@ void Runtime::InitIPCDmaBufSupport() { fn_amdgpu_device_get_fd = (int (*)(HsaAMDGPUDeviceHandle device_handle))dlsym(RTLD_DEFAULT, "amdgpu_device_get_fd"); if ((error = dlerror()) != NULL) { - debug_warning("amdgpu_device_get_fd not available. Please update version of libdrm"); + debug_warning(false && "amdgpu_device_get_fd not available. Please update version of libdrm"); fn_amdgpu_device_get_fd = &fn_amdgpu_device_get_fd_nosupport; } else { ipc_dmabuf_supported_ = !flag().enable_ipc_mode_legacy();