P4 to Git Change 1203838 by emankov@em-hsa-amd on 2015/10/26 11:43:45
SWDEV-77584 - ORCA RT: Preparations for enabling HSAIL on OpenCL 1.2 by default. Error handling for parseAllOptions. [Testing] pre check-in [Reviewer] German Andryeyev http://ocltc.amd.com/reviews/r/8800/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#188 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#212 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaprogram.cpp#21 edit
This commit is contained in:
@@ -770,7 +770,11 @@ cl_int Program::link(const std::vector<Program*>& inputPrograms,
|
||||
}
|
||||
}
|
||||
else {
|
||||
amd::option::parseAllOptions(compileOptions_, options);
|
||||
if (!amd::option::parseAllOptions(compileOptions_, options)) {
|
||||
buildStatus_ = CL_BUILD_ERROR;
|
||||
buildLog_ += options.optionsLog();
|
||||
LogError("Parsing compile options failed.");
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t start_time = 0;
|
||||
@@ -972,7 +976,7 @@ Program::getCompileOptionsAtLinking(const std::vector<Program*>& inputPrograms,
|
||||
if (!amd::option::parseAllOptions(program->compileOptions_,
|
||||
*thisCompileOptions)) {
|
||||
buildLog_ += thisCompileOptions->optionsLog();
|
||||
LogError("Bad compile options from input binary");
|
||||
LogError("Parsing compile options failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -993,7 +997,7 @@ Program::getCompileOptionsAtLinking(const std::vector<Program*>& inputPrograms,
|
||||
if (!amd::option::parseLinkOptions(program->linkOptions_,
|
||||
thisLinkOptions)) {
|
||||
buildLog_ += thisLinkOptions.optionsLog();
|
||||
LogError("Bad link options from input binary");
|
||||
LogError("Parsing link options failed.");
|
||||
return false;
|
||||
}
|
||||
if (thisLinkOptions.oVariables->clEnableLinkOptions)
|
||||
@@ -1002,7 +1006,7 @@ Program::getCompileOptionsAtLinking(const std::vector<Program*>& inputPrograms,
|
||||
if (linkOptsCanOverwrite) {
|
||||
if (!thisCompileOptions->setOptionVariablesAs(*linkOptions)) {
|
||||
buildLog_ += thisCompileOptions->optionsLog();
|
||||
LogError("Bad compile options from input binary");
|
||||
LogError("Setting link options failed.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1957,7 +1957,11 @@ HSAILProgram::getCompilationStagesFromBinary(std::vector<aclType>& completeStage
|
||||
}
|
||||
std::string sCurOptions = compileOptions_ + linkOptions_;
|
||||
amd::option::Options curOptions;
|
||||
amd::option::parseAllOptions(sCurOptions, curOptions);
|
||||
if (!amd::option::parseAllOptions(sCurOptions, curOptions)) {
|
||||
buildLog_ += curOptions.optionsLog();
|
||||
LogError("Parsing compile options failed.");
|
||||
return ACL_TYPE_DEFAULT;
|
||||
}
|
||||
switch (from) {
|
||||
// compile from HSAIL text, no matter prev. stages and options
|
||||
case ACL_TYPE_HSAIL_TEXT:
|
||||
@@ -2036,8 +2040,16 @@ HSAILProgram::getNextCompilationStageFromBinary(amd::option::Options* options) {
|
||||
std::string sBinOptions = std::string((char*)opts, symSize);
|
||||
std::string sCurOptions = compileOptions_ + linkOptions_;
|
||||
amd::option::Options curOptions, binOptions;
|
||||
amd::option::parseAllOptions(sBinOptions, binOptions);
|
||||
amd::option::parseAllOptions(sCurOptions, curOptions);
|
||||
if (!amd::option::parseAllOptions(sBinOptions, binOptions)) {
|
||||
buildLog_ += binOptions.optionsLog();
|
||||
LogError("Parsing compile options from binary failed.");
|
||||
return ACL_TYPE_DEFAULT;
|
||||
}
|
||||
if (!amd::option::parseAllOptions(sCurOptions, curOptions)) {
|
||||
buildLog_ += curOptions.optionsLog();
|
||||
LogError("Parsing compile options failed.");
|
||||
return ACL_TYPE_DEFAULT;
|
||||
}
|
||||
if (!curOptions.equals(binOptions)) {
|
||||
recompile = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user