From efedf0832720ef83fbbe322189479d422e13a0cb Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Wed, 27 Jul 2022 06:00:30 +0000 Subject: [PATCH] SWDEV-329516 - Don't clear error if setKernels returns false. Change-Id: I75f69bcdf01bad63a9273dc37afd69644f6b3b22 --- rocclr/device/devprogram.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rocclr/device/devprogram.cpp b/rocclr/device/devprogram.cpp index 4175518043..38303ee116 100644 --- a/rocclr/device/devprogram.cpp +++ b/rocclr/device/devprogram.cpp @@ -1753,12 +1753,13 @@ bool Program::trySubstObjFile(const char *SubstCfgFile, buildError_ = CL_BUILD_PROGRAM_FAILURE; str << "Subst failure: cannot read binary file " << substRes.first << '\n'; } else { - setKernels(binary, binSize); - buildStatus_ = CL_BUILD_SUCCESS; - buildError_ = 0; - str << "Substituted program hash 0x" - << std::setbase(16) << substRes.second - << " with " << substRes.first << '\n'; + if (setKernels(binary, binSize)) { + buildStatus_ = CL_BUILD_SUCCESS; + buildError_ = 0; + str << "Substituted program hash 0x" + << std::setbase(16) << substRes.second + << " with " << substRes.first << '\n'; + } } buildLog_ += str.str(); return true;