P4 to Git Change 1195721 by yaxunl@yaxunl_stg_win50 on 2015/09/29 20:02:58
SWDEV-77154 - SPIR-V: runtime change for separate compile/link of SPIR-V module. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_program.cpp#38 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#209 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#71 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.hpp#34 edit
This commit is contained in:
@@ -1801,9 +1801,27 @@ HSAILProgram::linkImpl(
|
||||
const void *llvmirText = aclExtractSection(dev().hsaCompiler(),
|
||||
binaryElf_, &llvmirSize, aclLLVMIR, &errorCode);
|
||||
if (errorCode != ACL_SUCCESS) {
|
||||
buildLog_ +="Error while linking : \
|
||||
bool spirv = false;
|
||||
size_t boolSize = sizeof(bool);
|
||||
errorCode = aclQueryInfo(dev().hsaCompiler(), binaryElf_,
|
||||
RT_CONTAINS_SPIRV, NULL, &spirv, &boolSize);
|
||||
if (errorCode != ACL_SUCCESS) {
|
||||
spirv = false;
|
||||
}
|
||||
if (spirv) {
|
||||
errorCode = aclCompile(dev().hsaCompiler(), binaryElf_,
|
||||
options->origOptionStr.c_str(), ACL_TYPE_SPIRV_BINARY,
|
||||
ACL_TYPE_LLVMIR_BINARY, NULL);
|
||||
buildLog_ += aclGetCompilerLog(dev().hsaCompiler());
|
||||
if (errorCode != ACL_SUCCESS) {
|
||||
buildLog_ += "Error while linking: Could not load SPIR-V" ;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
buildLog_ +="Error while linking : \
|
||||
Invalid binary (Missing LLVMIR section)" ;
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Create a new aclBinary for each LLVMIR and save it in a list
|
||||
aclBIFVersion ver = aclBinaryVersion(binaryElf_);
|
||||
|
||||
Reference in New Issue
Block a user