From 9e5f7e3a3c59dab521779a2800421fca05c44cd8 Mon Sep 17 00:00:00 2001 From: Siu Chi Chan Date: Thu, 26 Mar 2020 07:36:09 -0400 Subject: [PATCH] Initialize all undef symbols with a magic poison (#1962) [ROCm/hip commit: 8fefda2bb911a55f485cec42bb9c438fa3c3e402] --- projects/hip/src/program_state.inl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/hip/src/program_state.inl b/projects/hip/src/program_state.inl index 27fa9f2b0e..bdf127c9c5 100644 --- a/projects/hip/src/program_state.inl +++ b/projects/hip/src/program_state.inl @@ -355,8 +355,11 @@ public: const auto it1 = get_symbol_addresses().find(x); if (it1 == get_symbol_addresses().cend()) { - hip_throw(std::runtime_error{ - "Global symbol: " + x + " is undefined."}); + // For a unknown symbol, initialize it with a magic poison + hsa_executable_agent_global_variable_define( + executable, agent, x.c_str(), + reinterpret_cast(0xDEADBEEFDEADBEEFull)); + continue; } hsa_status_t status;