P4 to Git Change 1613522 by gandryey@gera-ocl-lc on 2018/10/02 11:44:38
SWDEV-79445 - OCL generic changes and code clean-up Program compilation clean-up. Step#7: - Introduce a new key to control the compilation path dynamically - InitBuild/finiBuild clean-up Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_device.cpp#73 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#231 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#321 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#9 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#7 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#245 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.hpp#78 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#111 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#67 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#25 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#80 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#36 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#58 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#43 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#93 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#41 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#37 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#96 edit ... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#299 edit
This commit is contained in:
@@ -48,13 +48,16 @@ const Symbol* Program::findSymbol(const char* kernelName) const {
|
||||
|
||||
cl_int Program::addDeviceProgram(Device& device, const void* image, size_t length,
|
||||
amd::option::Options* options) {
|
||||
if (image != NULL && !amd::isElfMagic((const char*)image)
|
||||
#if !defined(WITH_LIGHTNING_COMPILER)
|
||||
&& !aclValidateBinaryImage(
|
||||
image, length, language_ == SPIRV ? BINARY_TYPE_SPIRV : BINARY_TYPE_ELF | BINARY_TYPE_LLVM)
|
||||
#endif // !defined(WITH_LIGHTNING_COMPILER)
|
||||
) {
|
||||
return CL_INVALID_BINARY;
|
||||
if (image != NULL && !amd::isElfMagic((const char*)image)) {
|
||||
if (device.settings().useLightning_) {
|
||||
return CL_INVALID_BINARY;
|
||||
}
|
||||
#if defined(WITH_COMPILER_LIB)
|
||||
else if (!aclValidateBinaryImage(
|
||||
image, length, language_ == SPIRV ? BINARY_TYPE_SPIRV : BINARY_TYPE_ELF | BINARY_TYPE_LLVM)) {
|
||||
return CL_INVALID_BINARY;
|
||||
}
|
||||
#endif // !defined(WITH_COMPILER_LIB)
|
||||
}
|
||||
|
||||
// Check if the device is already associated with this program
|
||||
@@ -307,9 +310,7 @@ cl_int Program::link(const std::vector<Device*>& devices, size_t numInputs,
|
||||
}
|
||||
if (isHSAILTarget(*aclutGetTargetInfo(aclBin))) {
|
||||
parsedOptions.oVariables->Frontend = "clang";
|
||||
#if defined(WITH_LIGHTNING_COMPILER)
|
||||
parsedOptions.oVariables->Legacy = true;
|
||||
#endif // defined(WITH_LIGHTNING_COMPILER)
|
||||
parsedOptions.oVariables->Legacy = it->settings().useLightning_;
|
||||
} else if (isAMDILTarget(*aclutGetTargetInfo(aclBin))) {
|
||||
parsedOptions.oVariables->Frontend = "edg";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user