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
Αυτή η υποβολή περιλαμβάνεται σε:
foreman
2017-11-15 21:58:49 -05:00
γονέας 88783fe59b
υποβολή 5ec0d059a3
8 αρχεία άλλαξαν με 40 προσθήκες και 2 διαγραφές
@@ -76,6 +76,7 @@ cl_int Program::addDeviceProgram(Device& device, const void* image, size_t lengt
emptyOptions = true;
}
#if defined(WITH_COMPILER_LIB)
if (image != NULL && length != 0 && aclValidateBinaryImage(image, length, BINARY_TYPE_ELF)) {
acl_error errorCode;
aclBinary* binary = aclReadFromMem(image, length, &errorCode);
@@ -102,6 +103,7 @@ cl_int Program::addDeviceProgram(Device& device, const void* image, size_t lengt
isHSAILTarget(*aclutGetTargetInfo(binary));
aclBinaryFini(binary);
}
#endif // defined(WITH_COMPILER_LIB)
options->oVariables->BinaryIsSpirv = isSPIRV_;
device::Program* program = rootDev.createProgram(options);
if (program == NULL) {
@@ -296,6 +298,7 @@ cl_int Program::link(const std::vector<Device*>& devices, size_t numInputs,
// Check the binary's target for the first found device program.
// TODO: Revise these binary's target checks
// and possibly remove them after switching to HSAIL by default.
#if defined(WITH_COMPILER_LIB)
if (!found && binary.first != NULL && binary.second > 0 &&
aclValidateBinaryImage(binary.first, binary.second, BINARY_TYPE_ELF)) {
acl_error errorCode = ACL_SUCCESS;
@@ -315,6 +318,7 @@ cl_int Program::link(const std::vector<Device*>& devices, size_t numInputs,
}
aclBinaryFini(aclBin);
}
#endif // defined(WITH_COMPILER_LIB)
found = true;
}
if (inputDevPrograms.size() == 0) {