From 048e47d190144adc1f515c594d4b5010acd78282 Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 29 Oct 2019 12:23:34 -0400 Subject: [PATCH] P4 to Git Change 2021171 by gandryey@gera-win10 on 2019/10/29 12:06:07 SWDEV-208424 - ROCr language runtime should not free code object until executable destroy - Reshuffle the code to make sure HSA runtime can keep the pointer to the code object Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#67 edit [ROCm/clr commit: 783f1a506c6f874e855c635a79f14240317a1e5e] --- projects/clr/rocclr/runtime/device/devprogram.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/devprogram.cpp b/projects/clr/rocclr/runtime/device/devprogram.cpp index e9cd42114f..9945830ea8 100644 --- a/projects/clr/rocclr/runtime/device/devprogram.cpp +++ b/projects/clr/rocclr/runtime/device/devprogram.cpp @@ -1568,16 +1568,17 @@ bool Program::linkImplLC(amd::option::Options* options) { return false; } - if (!setKernels(options, executable, executableSize)) { - return false; - } - // Save the binary and type clBinary()->saveBIFBinary(executable, executableSize); // Destroy original memory with executable after compilation delete[] executable; + if (!setKernels(options, const_cast(clBinary()->data().first), + clBinary()->data().second)) { + return false; + } + setType(TYPE_EXECUTABLE); return true;