diff --git a/rocclr/runtime/device/devprogram.cpp b/rocclr/runtime/device/devprogram.cpp index e17394d43a..961f80b043 100644 --- a/rocclr/runtime/device/devprogram.cpp +++ b/rocclr/runtime/device/devprogram.cpp @@ -29,7 +29,6 @@ #include #include - #if defined(ATI_OS_LINUX) #include #include @@ -3205,6 +3204,25 @@ bool Program::getSymbolsFromCodeObj(std::vector* var_names, amd_com } #endif /* USE_COMGR_LIBRARY */ +const bool Program::getLoweredNames(std::vector* mangledNames) const { +#if defined (USE_COMGR_LIBRARY) + /* Iterate thru kernel names first */ + for (auto const& kernelMeta : kernelMetadataMap_) { + mangledNames->emplace_back(kernelMeta.first); + } + + /* Itrate thru global vars */ + if (!getSymbolsFromCodeObj(mangledNames, AMD_COMGR_SYMBOL_TYPE_OBJECT)) { + return false; + } + + return true; + +#else + assert("No COMGR loaded"); + return false; +#endif +} bool Program::getGlobalVarFromCodeObj(std::vector* var_names) const { #if defined(USE_COMGR_LIBRARY) return getSymbolsFromCodeObj(var_names, AMD_COMGR_SYMBOL_TYPE_OBJECT); diff --git a/rocclr/runtime/device/devprogram.hpp b/rocclr/runtime/device/devprogram.hpp index 7087f85b38..a4bf47986c 100644 --- a/rocclr/runtime/device/devprogram.hpp +++ b/rocclr/runtime/device/devprogram.hpp @@ -67,6 +67,11 @@ struct SymbolInfo { std::vector* var_names; }; +struct SymbolLoweredName { + const char* name_expression; + std::string* loweredName; +}; + //! A program object for a specific device. class Program : public amd::HeapObject { public: @@ -244,6 +249,9 @@ class Program : public amd::HeapObject { //! Check if program is HIP based const bool isHIP() const { return (isHIP_ == 1); } + //! Get mangled name of a name expresion + const bool getLoweredNames(std::vector* mangledNames) const; + bool getGlobalVarFromCodeObj(std::vector* var_names) const; bool getUndefinedVarFromCodeObj(std::vector* var_names) const;