diff --git a/rocclr/platform/program.cpp b/rocclr/platform/program.cpp index d31a8fe182..071e5beee3 100644 --- a/rocclr/platform/program.cpp +++ b/rocclr/platform/program.cpp @@ -437,16 +437,6 @@ int32_t Program::link(const std::vector& devices, size_t numInputs, } } - // Create a string with all kernel names from the program - if (kernelNames_.length() == 0) { - for (auto it = symbols().cbegin(); it != symbols().cend(); ++it) { - if (it != symbols().cbegin()) { - kernelNames_.append(1, ';'); - } - kernelNames_.append(it->first.c_str()); - } - } - if (notifyFptr != NULL) { notifyFptr(as_cl(this), data); } @@ -602,16 +592,6 @@ int32_t Program::build(const std::vector& devices, const char* options, } } } - - // Create a string with all kernel names from the program - if (kernelNames_.length() == 0) { - for (auto it = symbols().cbegin(); it != symbols().cend(); ++it) { - if (it != symbols().cbegin()) { - kernelNames_.append(1, ';'); - } - kernelNames_.append(it->first.c_str()); - } - } } if (notifyFptr != NULL) { @@ -647,6 +627,19 @@ bool Program::load(const std::vector& devices) { return true; } +const std::string& Program::kernelNames() { + // Create a string with all kernel names from the program + if (kernelNames_.length() == 0) { + for (auto it = symbols().cbegin(); it != symbols().cend(); ++it) { + if (it != symbols().cbegin()) { + kernelNames_.append(1, ';'); + } + kernelNames_.append(it->first.c_str()); + } + } + return kernelNames_; +} + void Program::clear() { // Destroy old programs if we have any for (const auto& it : devicePrograms_) { diff --git a/rocclr/platform/program.hpp b/rocclr/platform/program.hpp index c624994132..ba6b88face 100644 --- a/rocclr/platform/program.hpp +++ b/rocclr/platform/program.hpp @@ -201,7 +201,7 @@ class Program : public RuntimeObject { const binary_t& binary(const Device& device) { return binary_[&device]; } //! Return the program kernel names - const std::string& kernelNames() const { return kernelNames_; } + const std::string& kernelNames(); //! Compile the program for the given devices. int32_t compile(const std::vector& devices, size_t numHeaders,