From 22b26ca387d14a6e27f31804817f9613697973cb Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 20 Jan 2016 17:10:22 -0500
Subject: [PATCH] P4 to Git Change 1229520 by
fdaniil@spb_fdaniil_amd_hsa_brigvar_test on 2016/01/20 17:01:23
SWDEV-82159 - [CQE OCL][ISV][QR] Error is observed while debugging the sample with CodeXL; Faulty CL:1208929
[Synopsis]
compile from binary logic changes caused issue with resulting binary generation in CodeXL
[Solution]
do not use compile options from binary if they are explicitly specified
[Testing]
precheckin, MCL
Reviewed by Evgeniy Mankov, German Andryeyev
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#78 edit
---
rocclr/runtime/platform/program.cpp | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/rocclr/runtime/platform/program.cpp b/rocclr/runtime/platform/program.cpp
index c5a8a2a7d3..c667d858de 100644
--- a/rocclr/runtime/platform/program.cpp
+++ b/rocclr/runtime/platform/program.cpp
@@ -75,9 +75,6 @@ Program::addDeviceProgram(Device& device, const void* image, size_t length,
acl_error errorCode;
aclBinary *binary = aclReadFromMem(image, length, &errorCode);
if (errorCode != ACL_SUCCESS) {
- if (emptyOptions) {
- options = NULL;
- }
return CL_INVALID_BINARY;
}
const oclBIFSymbolStruct* symbol = findBIF30SymStruct(symOpenclCompilerOptions);
@@ -86,14 +83,12 @@ Program::addDeviceProgram(Device& device, const void* image, size_t length,
size_t symSize = 0;
const void *opts = aclExtractSymbol(device.compiler(),
binary, &symSize, aclCOMMENT, symName.c_str(), &errorCode);
- if (opts != NULL) {
+ // if we have options from binary and input options was not specified
+ if (opts != NULL && emptyOptions) {
std::string sBinOptions = std::string((char*)opts, symSize);
if (!amd::option::parseAllOptions(sBinOptions, *options)) {
programLog_ = options->optionsLog();
LogError("Parsing compilation options from binary failed.");
- if (emptyOptions) {
- options = NULL;
- }
return CL_INVALID_COMPILER_OPTIONS;
}
}
@@ -101,9 +96,6 @@ Program::addDeviceProgram(Device& device, const void* image, size_t length,
}
options->oVariables->BinaryIsSpirv = isSPIRV_;
device::Program* program = rootDev.createProgram(options);
- if (emptyOptions) {
- options = NULL;
- }
if (program == NULL) {
return CL_OUT_OF_HOST_MEMORY;
}