P4 to Git Change 1313945 by wchau@wchau_OCL_boltzmann on 2016/09/13 15:57:45

SWDEV-94605 - [OCL-LC-ROCm] ability to load offline (and online) generated binaries using the HSA code object format

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#203 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#17 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#35 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#83 edit
이 커밋은 다음에 포함됨:
foreman
2016-09-13 16:16:35 -04:00
부모 a1009a5d11
커밋 0495f895a2
5개의 변경된 파일128개의 추가작업 그리고 55개의 파일을 삭제
+14 -5
파일 보기
@@ -78,11 +78,8 @@ Program::addDeviceProgram(Device& device, const void* image, size_t length,
options = &emptyOpts;
emptyOptions = true;
}
#if defined(WITH_LIGHTNING_COMPILER)
if (image != NULL && length != 0 && amd::isElfMagic((const char *) image)) {
// TODO: Wilkin: extract compiler options from the .comment section
}
#else // !defined(WITH_LIGHTNING_COMPILER)
#if !defined(WITH_LIGHTNING_COMPILER)
if (image != NULL && length != 0 && aclValidateBinaryImage(image, length, BINARY_TYPE_ELF)) {
acl_error errorCode;
aclBinary *binary = aclReadFromMem(image, length, &errorCode);
@@ -133,6 +130,18 @@ Program::addDeviceProgram(Device& device, const void* image, size_t length,
delete program;
return CL_INVALID_BINARY;
}
#if defined(WITH_LIGHTNING_COMPILER)
// load the compiler options from the binary if it is not provided
std::string sBinOptions = program->compileOptions();
if (!sBinOptions.empty() && emptyOptions) {
if (!amd::option::parseAllOptions(sBinOptions, *options)) {
programLog_ = options->optionsLog();
LogError("Parsing compilation options from binary failed.");
return CL_INVALID_COMPILER_OPTIONS;
}
}
#endif
}
devicePrograms_[&rootDev] = program;