P4 to Git Change 1221023 by yaxunl@yaxunl_stg_win50 on 2015/12/15 12:50:27

SWDEV-83705 - [SPIRV] Refactor aclUpdateRawFile as a static function called by SPIRVToModule.

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_8/acl.cpp#39 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#88 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_8/acl.h#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#216 edit
This commit is contained in:
foreman
2015-12-15 13:07:52 -05:00
parent 82415554d4
commit 4df676dc36
3 changed files with 16 additions and 6 deletions
@@ -386,6 +386,18 @@ OCLFEToModule(
return module;
}
/// Update elf e_rawfile buffer.
static acl_error
updateElfRawFile(aclBinary *bin)
{
if (bin == NULL
|| bin->bin == NULL) {
return ACL_INVALID_ARG;
}
bifbase *elfBin = reinterpret_cast<bifbase*>(bin->bin);
return elfBin->updateRawFile() ? ACL_SUCCESS : ACL_ELF_ERROR;
}
aclModule* ACL_API_ENTRY
SPIRVToModule(
aclLoaderData *ald,
@@ -449,7 +461,11 @@ SPIRVToModule(
outstream.flush();
auto errCode = cl->clAPI.insSec(cl, bin, &array[0], array.size(), aclLLVMIR);
if (error != nullptr) (*error) = errCode;
if (errCode != ACL_SUCCESS)
return reinterpret_cast<aclModule*>(llMod);
errCode = updateElfRawFile(bin);
if (error != nullptr) (*error) = errCode;
return reinterpret_cast<aclModule*>(llMod);
#endif // LEGACY_COMPLIB
}
-3
View File
@@ -98,9 +98,6 @@ 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;
-3
View File
@@ -1821,9 +1821,6 @@ 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)" ;