From b4f5366fe4d2c2a6da146e4537dc42ac1a3524a9 Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 28 Dec 2015 05:53:39 -0500
Subject: [PATCH] P4 to Git Change 1223703 by nhaustov@nhaustov_hsa on
2015/12/28 05:46:00
SWDEV-77584 - Fix ocl_conformance compiler failures.
1. If compiling in debug mode, linkImpl wasn't called and kernelNames wasn't set
which led to CL_INVALID_KERNEL_NAME errors in debug configs in TeamCity. Looking at AMDIL
code, there is no reason to skip linkImpl in debug mode.
2. Set types to TYPE_LIBRARY/TYPE_EXECUTABLE. This fixes ocl_conformance compiler program_binary_type.
Reviewed by: Evgeniy Mankov
Testing: smoke, pre-checkin, OCLSeparateCompile.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#218 edit
---
rocclr/runtime/device/gpu/gpuprogram.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/rocclr/runtime/device/gpu/gpuprogram.cpp b/rocclr/runtime/device/gpu/gpuprogram.cpp
index 78e8442c53..15a0a452ae 100644
--- a/rocclr/runtime/device/gpu/gpuprogram.cpp
+++ b/rocclr/runtime/device/gpu/gpuprogram.cpp
@@ -1862,12 +1862,13 @@ HSAILProgram::linkImpl(
for (size_t i = 1; i < binaries_to_link.size(); i++) {
aclBinaryFini(binaries_to_link[i]);
}
- if (createLibrary || options->oVariables->EnableDebug) {
+ if (createLibrary) {
size_t size = 0;
void *mem = NULL;
aclWriteToMem(binaryElf_, &mem, &size);
setBinary(static_cast(mem), size);
buildLog_ += aclGetCompilerLog(dev().hsaCompiler());
+ setType(TYPE_LIBRARY);
return true;
}
// Now call linkImpl with the new options
@@ -2231,6 +2232,7 @@ HSAILProgram::linkImpl(amd::option::Options* options)
aclWriteToMem(binaryElf_, &mem, &size);
setBinary(static_cast(mem), size);
buildLog_ += aclGetCompilerLog(dev().hsaCompiler());
+ setType(TYPE_EXECUTABLE);
return true;
}