From 7265b71a1c9a498122cf814c33a7e2d784b2c19b Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 16 Nov 2018 14:10:39 -0500
Subject: [PATCH] P4 to Git Change 1708308 by wchau@wchau_OCL_boltzmann on
2018/11/16 14:01:10
SWDEV-167383 - [OCL]: Switch to new object format
- Disable code object v3 for blit programs
- Porting the changes made by Konstantin (http://git.amd.com:8080/#/c/187605)
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#234 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#13 edit
---
rocclr/runtime/device/device.cpp | 3 +++
rocclr/runtime/device/devprogram.cpp | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/rocclr/runtime/device/device.cpp b/rocclr/runtime/device/device.cpp
index c1e45e41d1..262ddd3243 100644
--- a/rocclr/runtime/device/device.cpp
+++ b/rocclr/runtime/device/device.cpp
@@ -123,6 +123,9 @@ 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 54be1bdc5f..28d06e0fff 100644
--- a/rocclr/runtime/device/devprogram.cpp
+++ b/rocclr/runtime/device/devprogram.cpp
@@ -1329,6 +1329,8 @@ bool Program::linkImplLC(amd::option::Options* options) {
// 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");
// NOTE: The params is also used to identy cached code object. This parameter
// should not contain any dyanamically generated filename.
@@ -1533,6 +1535,8 @@ bool Program::linkImplLC(amd::option::Options* options) {
// 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");
// Tokenize the options string into a vector of strings
std::istringstream strstr(codegenOptions);