diff --git a/rocclr/device/comgrctx.cpp b/rocclr/device/comgrctx.cpp index 977b328d8a..fd5b8dea4c 100644 --- a/rocclr/device/comgrctx.cpp +++ b/rocclr/device/comgrctx.cpp @@ -85,7 +85,7 @@ bool Comgr::LoadLib() { GET_COMGR_SYMBOL(amd_comgr_iterate_symbols) GET_COMGR_SYMBOL(amd_comgr_symbol_lookup) GET_COMGR_SYMBOL(amd_comgr_symbol_get_info) - GET_COMGR_SYMBOL(amd_comgr_demangle_symbol_name) + GET_COMGR_OPTIONAL_SYMBOL(amd_comgr_demangle_symbol_name) is_ready_ = true; return true; } diff --git a/rocclr/device/comgrctx.hpp b/rocclr/device/comgrctx.hpp index c73cee4a4c..d69506e287 100644 --- a/rocclr/device/comgrctx.hpp +++ b/rocclr/device/comgrctx.hpp @@ -128,9 +128,12 @@ struct ComgrEntryPoints { #define GET_COMGR_SYMBOL(NAME) cep_.NAME = \ reinterpret_cast(Os::getSymbol(cep_.handle, #NAME)); \ if (nullptr == cep_.NAME) { return false; } +#define GET_COMGR_OPTIONAL_SYMBOL(NAME) cep_.NAME = \ + reinterpret_cast(Os::getSymbol(cep_.handle, #NAME)); #else #define COMGR_DYN(NAME) NAME #define GET_COMGR_SYMBOL(NAME) +#define GET_COMGR_OPTIONAL_SYMBOL(NAME) #endif class Comgr : public amd::AllStatic { @@ -278,6 +281,13 @@ public: } static amd_comgr_status_t demangle_symbol_name(amd_comgr_data_t MangledSymbolName, amd_comgr_data_t* DemangledSymbolName) { +#if defined(COMGR_DYN_DLL) + if (cep_.amd_comgr_demangle_symbol_name == nullptr) { + ClPrint(amd::LOG_ERROR, amd::LOG_CODE, + "Failed to load COMGR function amd_comgr_demangle_symbol_name"); + return AMD_COMGR_STATUS_ERROR; + } +#endif return COMGR_DYN(amd_comgr_demangle_symbol_name)(MangledSymbolName, DemangledSymbolName); }