Skip to content

Commit 4d96f2e

Browse files
committed
rocr: Move _loader_debug_state to rocr namespace
This avoids exposing the symbol to the default namespace Change-Id: I2fe5fbab4b59f271effacab93eeb2d95c236ae02
1 parent 8135ac2 commit 4d96f2e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

runtime/hsa-runtime/core/runtime/runtime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ ROCPROFILER_REGISTER_DEFINE_IMPORT(hsa, ROCP_REG_VERSION)
101101
const char rocrbuildid[] __attribute__((used)) = "ROCR BUILD ID: " STRING(ROCR_BUILD_ID);
102102

103103
extern r_debug _amdgpu_r_debug;
104-
extern void _loader_debug_state();
105104

106105
namespace rocr {
106+
extern void _loader_debug_state();
107107
namespace core {
108108
bool g_use_interrupt_wait;
109109
bool g_use_mwaitx;

runtime/hsa-runtime/loader/executable.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@
6666
using namespace rocr::amd::hsa;
6767
using namespace rocr::amd::hsa::common;
6868

69-
// Having a side effect prevents call site optimization that allows removal of a noinline function call
70-
// with no side effect.
71-
__attribute__((noinline)) void _loader_debug_state() {
72-
static volatile int function_needs_a_side_effect = 0;
73-
function_needs_a_side_effect ^= 1;
74-
}
7569
// r_version history:
7670
// 1: Initial debug protocol
7771
// 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() {
9286
}
9387

9488
namespace rocr {
89+
// Having a side effect prevents call site optimization that allows removal of a noinline function call
90+
// with no side effect.
91+
__attribute__((noinline)) void _loader_debug_state() {
92+
static volatile int function_needs_a_side_effect = 0;
93+
function_needs_a_side_effect ^= 1;
94+
}
95+
9596
namespace amd {
9697
namespace hsa {
9798
namespace loader {

0 commit comments

Comments
 (0)