P4 to Git Change 2008325 by gandryey@gera-win10 on 2019/10/03 17:06:49

SWDEV-204999 - [hipclang-vdi-rocm] TF unit test tracking.util_xla_test_gpu fails to run
	- Change the HSACO detection logic to use e_machine
	- Allow to load a binary without any kernel.

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/elf.hpp#27 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#63 edit


[ROCm/clr commit: 02fbea29d6]
This commit is contained in:
foreman
2019-10-03 17:12:38 -04:00
والد 31a9ed09c7
کامیت 518f6edb43
2فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
@@ -2574,8 +2574,7 @@ bool Program::setBinary(const char* binaryIn, size_t size) {
case ET_DYN: {
char* sect = nullptr;
size_t sz = 0;
// FIXME: we should look for the e_machine to detect an HSACO.
if (clBinary()->elfIn()->getSection(amd::OclElf::TEXT, &sect, &sz) && sect && sz > 0) {
if (clBinary()->elfIn()->isHsaCo()) {
setType(TYPE_EXECUTABLE);
} else {
setType(TYPE_LIBRARY);
@@ -2910,6 +2909,9 @@ bool Program::createKernelMetadataMap() {
if (status == AMD_COMGR_STATUS_SUCCESS) {
status = amd::Comgr::get_metadata_list_size(kernelsMD, &size);
} else if (amd::IS_HIP) {
// Assume an empty binary. HIP may have binaries with just global variables
return true;
}
for (size_t i = 0; i < size && status == AMD_COMGR_STATUS_SUCCESS; i++) {