diff --git a/runtime/hsa-runtime/core/runtime/runtime.cpp b/runtime/hsa-runtime/core/runtime/runtime.cpp index 83d303471a..e3d4794ca5 100644 --- a/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -101,9 +101,9 @@ ROCPROFILER_REGISTER_DEFINE_IMPORT(hsa, ROCP_REG_VERSION) const char rocrbuildid[] __attribute__((used)) = "ROCR BUILD ID: " STRING(ROCR_BUILD_ID); extern r_debug _amdgpu_r_debug; -extern void _loader_debug_state(); namespace rocr { +extern void _loader_debug_state(); namespace core { bool g_use_interrupt_wait; bool g_use_mwaitx; diff --git a/runtime/hsa-runtime/loader/executable.cpp b/runtime/hsa-runtime/loader/executable.cpp index 36b285beac..807402969c 100644 --- a/runtime/hsa-runtime/loader/executable.cpp +++ b/runtime/hsa-runtime/loader/executable.cpp @@ -66,12 +66,6 @@ using namespace rocr::amd::hsa; using namespace rocr::amd::hsa::common; -// Having a side effect prevents call site optimization that allows removal of a noinline function call -// with no side effect. -__attribute__((noinline)) void _loader_debug_state() { - static volatile int function_needs_a_side_effect = 0; - function_needs_a_side_effect ^= 1; -} // r_version history: // 1: Initial debug protocol // 2: New trap handler ABI. The reason for halting a wave is recorded in ttmp11[8:7]. @@ -92,6 +86,13 @@ static __forceinline link_map*& r_debug_tail() { } namespace rocr { + // Having a side effect prevents call site optimization that allows removal of a noinline function call + // with no side effect. +__attribute__((noinline)) void _loader_debug_state() { + static volatile int function_needs_a_side_effect = 0; + function_needs_a_side_effect ^= 1; +} + namespace amd { namespace hsa { namespace loader {