From 0a284d5913bb3547d368b72429b40e4ff3790830 Mon Sep 17 00:00:00 2001 From: foreman Date: Fri, 23 Nov 2018 15:11:58 -0500 Subject: [PATCH] P4 to Git Change 1711343 by gandryey@gera-ocl-lc on 2018/11/23 15:00:30 SWDEV-79445 - OCL generic changes and code clean-up - Fix kernel compilation with COMgr. CodeobjectV3 has to be disabled during the kernel compilation also, not just linking. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#235 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#16 edit --- rocclr/runtime/device/device.cpp | 3 --- rocclr/runtime/device/devprogram.cpp | 10 ++++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/rocclr/runtime/device/device.cpp b/rocclr/runtime/device/device.cpp index 262ddd3243..c1e45e41d1 100644 --- a/rocclr/runtime/device/device.cpp +++ b/rocclr/runtime/device/device.cpp @@ -123,9 +123,6 @@ bool Device::BlitProgram::create(amd::Device* device, const char* extraKernels, if (!device->settings().useLightning_) { opt += "-Wf,--force_disable_spir -fno-lib-no-inline -fno-sc-keep-calls "; } - else { - opt += "-Wf,-mno-code-object-v3 "; - } if (extraOptions != nullptr) { opt += extraOptions; diff --git a/rocclr/runtime/device/devprogram.cpp b/rocclr/runtime/device/devprogram.cpp index b1332b5c86..d13fd0e859 100644 --- a/rocclr/runtime/device/devprogram.cpp +++ b/rocclr/runtime/device/devprogram.cpp @@ -541,6 +541,8 @@ bool Program::compileImplLC(const std::string& sourceCode, driverOptions.append(options->llvmOptions); driverOptions.append(ProcessOptions(options)); + // Force object code v2. + driverOptions.append(" -mno-code-object-v3"); // Set whole program mode driverOptions.append(" -mllvm -amdgpu-early-inline-all -mllvm -amdgpu-prelink"); @@ -1329,10 +1331,10 @@ bool Program::linkImplLC(amd::option::Options* options) { std::ostream_iterator(ostrstr, " ")); codegenOptions.append(" ").append(ostrstr.str()); - // Set whole program mode - codegenOptions.append(" -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all"); // Force object code v2. codegenOptions.append(" -mno-code-object-v3"); + // Set whole program mode + codegenOptions.append(" -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all"); // NOTE: The params is also used to identy cached code object. This parameter // should not contain any dyanamically generated filename. @@ -1539,10 +1541,10 @@ bool Program::linkImplLC(amd::option::Options* options) { std::ostream_iterator(ostrstr, " ")); codegenOptions.append(" ").append(ostrstr.str()); - // Set whole program mode - codegenOptions.append(" -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all"); // Force object code v2. codegenOptions.append(" -mno-code-object-v3"); + // Set whole program mode + codegenOptions.append(" -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all"); // Tokenize the options string into a vector of strings std::istringstream strstr(codegenOptions);