From 91bbd98a0b54183aa2ba22c4bb7df5ace676ac34 Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 19 Jan 2016 11:03:37 -0500 Subject: [PATCH] P4 to Git Change 1228888 by avolkov@spb-hlc-kv25_opencl_stgsc on 2016/01/19 10:49:38 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SWDEV-83192 - [CQE OCL][2.0][QR] Few MCLSubtests are falling due to faulty cl#1208929 [Synopsis] Failure is because of additional check on compilation options existence in binary, which are expected in a separate section in the input binary. Options are expected on HSAIL path in order to make a decision whether to recompile or not the input code. AMDIL path has another strategy for recompilation algorithm and doesn't need options to be obligatory presented in input binary. [Solution] Remove options existence check in the input binary when compiling from BINARY_TYPE_ELF. P.S. With the fix HSAIL path also doesn’t require compilation options existence in input binary anymore. Recompilation will be done silently in such case. [Testing] Pre checkin, MCL Reviewed by Evgeniy Mankov, Nikolay Haustov, German Andryeyev http://ocltc.amd.com/reviews/r/9560/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#77 edit --- rocclr/runtime/platform/program.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/rocclr/runtime/platform/program.cpp b/rocclr/runtime/platform/program.cpp index 61aa1550c0..c5a8a2a7d3 100644 --- a/rocclr/runtime/platform/program.cpp +++ b/rocclr/runtime/platform/program.cpp @@ -86,20 +86,16 @@ 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 (errorCode != ACL_SUCCESS) { - if (emptyOptions) { - options = NULL; + if (opts != NULL) { + 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; } - return CL_INVALID_BINARY; - } - 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; } options->oVariables->Legacy = isAMDILTarget(*aclutGetTargetInfo(binary)); }