From c999a76da23ed7ef71d73457be32e44d88a7f3b3 Mon Sep 17 00:00:00 2001 From: foreman Date: Wed, 4 Dec 2019 14:22:03 -0500 Subject: [PATCH] P4 to Git Change 2040890 by skudchad@skudchad_test2_win_opencl on 2019/12/04 14:16:51 SWDEV-203814 - HIPRTC Inprocess runtime changes(part2) ReviewBoardURL = http://ocltc.amd.com/reviews/r/18342/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_hcc.def.in#37 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_hcc.map.in#35 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_module.cpp#50 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_rtc.cpp#8 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#73 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#38 edit --- rocclr/runtime/device/devprogram.cpp | 20 +++++++++++++++++++- rocclr/runtime/device/devprogram.hpp | 8 ++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) 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;