P4 to Git Change 1220218 by yaxunl@yaxunl_stg_win50 on 2015/12/11 16:35:30
SWDEV-83705 - [SPIRV] Fix failure in SPIR-V conformance test compile_and_link.
e_rawfile of elf needs to be updated after LLVM section is inserted into the elf containing SPIR-V.
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_8/acl.cpp#38 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#87 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_8/acl.h#11 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/bifbase.cpp#54 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/bifbase.hpp#24 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/libUtils.cpp#13 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/libUtils.h#23 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#215 edit
[ROCm/clr commit: f5acde74f7]
Этот коммит содержится в:
@@ -1670,6 +1670,10 @@ if_aclLink(aclCompiler *cl,
|
||||
const void *ptr = cl->clAPI.extSec(cl, src_bin, &data_size, aclLLVMIR, &error_code);
|
||||
if (ptr == NULL)
|
||||
ptr = cl->clAPI.extSec(cl, src_bin, &data_size, aclSPIR, &error_code);
|
||||
if (ptr == NULL) {
|
||||
error_code = ACL_INVALID_FILE;
|
||||
goto internal_link_failure;
|
||||
}
|
||||
char *mod = new char[data_size];
|
||||
memcpy(mod, ptr, data_size);
|
||||
module = cl->feAPI.toModule(ald, mod, data_size, context, &error_code);
|
||||
@@ -1677,7 +1681,10 @@ if_aclLink(aclCompiler *cl,
|
||||
const void *ptr = cl->clAPI.extSec(cl, libs[x], &data_size, aclLLVMIR, NULL);
|
||||
if (ptr == NULL)
|
||||
ptr = cl->clAPI.extSec(cl, libs[x], &data_size, aclSPIR, NULL);
|
||||
if (ptr == NULL) continue;
|
||||
if (ptr == NULL) {
|
||||
error_code = ACL_INVALID_FILE;
|
||||
goto internal_link_failure;
|
||||
}
|
||||
mod = new char[data_size];
|
||||
memcpy(mod, ptr, data_size);
|
||||
mod_libs[x] = cl->feAPI.toModule(ald, mod, data_size, context, &error_code);
|
||||
|
||||
@@ -98,6 +98,9 @@ acl_error ACL_API_ENTRY
|
||||
aclWriteToMem(aclBinary *bin,
|
||||
void **mem, size_t *size) ACL_API_0_8;
|
||||
|
||||
acl_error ACL_API_ENTRY
|
||||
aclUpdateRawFile(aclBinary *bin);
|
||||
|
||||
aclBinary* ACL_API_ENTRY
|
||||
aclCreateFromBinary(const aclBinary *binary,
|
||||
aclBIFVersion version) ACL_API_0_8;
|
||||
|
||||
@@ -1043,3 +1043,8 @@ convertBIF31ToBIF30(aclBinary *src) {
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
void dump(aclBinary *bin) {
|
||||
bifbase *elfBin = reinterpret_cast<bifbase*>(bin->bin);
|
||||
elfBin->dump();
|
||||
}
|
||||
|
||||
@@ -391,4 +391,6 @@ isBcMagic(const char* p)
|
||||
return true;
|
||||
}
|
||||
|
||||
void dump(aclBinary *bin);
|
||||
|
||||
#endif // _CL_LIB_UTILS_0_8_H_
|
||||
|
||||
@@ -1821,6 +1821,9 @@ HSAILProgram::linkImpl(
|
||||
buildLog_ += "Error while linking: Could not load SPIR-V" ;
|
||||
return false;
|
||||
}
|
||||
// Need to update elf raw file since it will be used by
|
||||
// aclCreateFromBinary.
|
||||
aclUpdateRawFile(binaryElf_);
|
||||
} else {
|
||||
buildLog_ +="Error while linking : \
|
||||
Invalid binary (Missing LLVMIR section)" ;
|
||||
|
||||
Ссылка в новой задаче
Block a user