P4 to Git Change 1483021 by lmoriche@lmoriche_opencl_dev2 on 2017/11/15 21:49:30

SWDEV-118564 - [OCL-LC-ROCm] Disable HSAILProgram and HSAILKernel if the compiler library is not available.

Affected files ...

... //depot/stg/opencl/drivers/opencl/opencldefs#222 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#214 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#39 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#76 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.hpp#18 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#76 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#89 edit
This commit is contained in:
foreman
2017-11-15 21:58:49 -05:00
parent 88783fe59b
commit 5ec0d059a3
8 changed files with 40 additions and 2 deletions
+10 -1
View File
@@ -190,6 +190,7 @@ aclType Program::getNextCompilationStageFromBinary(amd::option::Options* options
binary_t binary = this->binary();
// If the binary already exists
if ((binary.first != nullptr) && (binary.second > 0)) {
#if defined(WITH_COMPILER_LIB)
if (aclValidateBinaryImage(binary.first, binary.second, BINARY_TYPE_ELF)) {
acl_error errorCode;
binaryElf_ = aclReadFromMem(binary.first, binary.second, &errorCode);
@@ -198,6 +199,7 @@ aclType Program::getNextCompilationStageFromBinary(amd::option::Options* options
return continueCompileFrom;
}
}
#endif // defined(WITH_COMPILER_LIB)
// save the current options
std::string sCurCompileOptions = compileOptions_;
@@ -227,6 +229,7 @@ aclType Program::getNextCompilationStageFromBinary(amd::option::Options* options
if (compileOptions_.empty()) break;
std::string sBinOptions;
#if defined(WITH_COMPILER_LIB)
if (binaryElf_ != nullptr) {
const oclBIFSymbolStruct* symbol = findBIF30SymStruct(symOpenclCompilerOptions);
assert(symbol && "symbol not found");
@@ -242,7 +245,9 @@ aclType Program::getNextCompilationStageFromBinary(amd::option::Options* options
break;
}
sBinOptions = std::string((char*)opts, symSize);
} else {
} else
#endif // defined(WITH_COMPILER_LIB)
{
sBinOptions = sCurOptions;
}
@@ -282,6 +287,7 @@ aclType Program::getNextCompilationStageFromBinary(amd::option::Options* options
return continueCompileFrom;
}
#if defined(WITH_COMPILER_LIB)
std::string HSAILProgram::codegenOptions(amd::option::Options* options) {
std::string optionsStr;
@@ -294,6 +300,7 @@ std::string HSAILProgram::codegenOptions(amd::option::Options* options) {
return optionsStr;
}
#endif // defined(WITH_COMPILER_LIB)
std::string Program::preprocessorOptions(amd::option::Options* options) {
std::string optionsStr;
@@ -368,6 +375,7 @@ std::string Program::preprocessorOptions(amd::option::Options* options) {
return optionsStr;
}
#if defined(WITH_COMPILER_LIB)
HSAILProgram::HSAILProgram(roc::NullDevice& device) : roc::Program(device) {
}
@@ -816,6 +824,7 @@ bool HSAILProgram::linkImpl(amd::option::Options* options) {
buildLog_ += aclGetCompilerLog(device().compiler());
return true;
}
#endif // defined(WITH_COMPILER_LIB)
#if defined(WITH_LIGHTNING_COMPILER)
LightningProgram::LightningProgram(roc::NullDevice& device) : roc::Program(device) {