From 3e4332a85fdb5276ae22179ffdc936e09753a1c3 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 5 Nov 2015 07:02:25 -0500
Subject: [PATCH] P4 to Git Change 1207850 by emankov@em-hsa-amd on 2015/11/05
06:54:22
SWDEV-77584 - ORCA RT: Preparations for enabling HSAIL on OpenCL 1.2 by default. Restore setBinary while linking GPU program.
After CL 1205315 "Call aclLink always even for single library/binary." setting OCL Binary should work without setting library type for the program by setType(TYPE_LIBRARY).
[Testing] pre check-in
http://ocltc.amd.com:8111/viewModification.html?modId=61694&personal=true&buildTypeId=&tab=vcsModificationBuilds&show_all_builds=true
[Reviewer] German Andryeyev
http://ocltc.amd.com/reviews/r/8850
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#214 edit
---
rocclr/runtime/device/gpu/gpuprogram.cpp | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/rocclr/runtime/device/gpu/gpuprogram.cpp b/rocclr/runtime/device/gpu/gpuprogram.cpp
index 596c8d6ac1..3b915235b4 100644
--- a/rocclr/runtime/device/gpu/gpuprogram.cpp
+++ b/rocclr/runtime/device/gpu/gpuprogram.cpp
@@ -1848,20 +1848,14 @@ HSAILProgram::linkImpl(
for (size_t i = 1; i < binaries_to_link.size(); i++) {
aclBinaryFini(binaries_to_link[i]);
}
- // Uncomment when CL1.2 support on HSAIL is enabled,
- // Otherwise ocltst's OCLSeparateCompile will fail
- // on the non-legacy path with CL1.2
- // if (createLibrary || options->oVariables->EnableDebug) {
- // // Save the binary in the interface class
- // size_t size = 0;
- // void *mem = NULL;
- // aclWriteToMem(binaryElf_, &mem, &size);
- // setBinary(static_cast(mem), size);
- // if (createLibrary)
- // setType(TYPE_LIBRARY);
- // buildLog_ += aclGetCompilerLog(dev().hsaCompiler());
- // return true;
- // }
+ if (createLibrary || options->oVariables->EnableDebug) {
+ size_t size = 0;
+ void *mem = NULL;
+ aclWriteToMem(binaryElf_, &mem, &size);
+ setBinary(static_cast(mem), size);
+ buildLog_ += aclGetCompilerLog(dev().hsaCompiler());
+ return true;
+ }
// Now call linkImpl with the new options
return linkImpl(options);
}