P4 to Git Change 1404293 by lmoriche@lmoriche_opencl_dev2 on 2017/05/01 16:43:07

SWDEV-102726 - [OCL-LC-ROCm] Open source OpenCL Runtime
	- Changes required to use the Khronos ICD sources instead of ours.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/CMakeLists.txt#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#54 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_icd.cpp#29 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/CMakeLists.txt#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpubinary.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpubinary.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#319 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#127 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#233 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#239 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/object.hpp#18 edit
This commit is contained in:
foreman
2017-05-01 15:54:18 -05:00
parent d26b48851b
commit 0af2c7043c
8 changed files with 59 additions and 35 deletions
+12 -12
View File
@@ -27,7 +27,7 @@ ClBinary::FeatureCheckResult ClBinary::checkFeatures() {
amd::OclElf::oclElfPlatform platform;
if (!elfIn()->getTarget(elf_target, platform)) {
LogError("Loading OCL CPU binary: incorrect format");
return ERROR;
return fcERROR;
}
uint64_t chip_options = 0x0;
if (platform == amd::OclElf::COMPLIB_PLATFORM) {
@@ -35,7 +35,7 @@ ClBinary::FeatureCheckResult ClBinary::checkFeatures() {
uint32_t flag;
if (!elfIn()->getFlags(flag)) {
LogError("Loading OCL CPU binary: incorrect format");
return ERROR;
return fcERROR;
}
aclTargetInfo tgtInfo = aclGetTargetInfoFromChipID(LP64_SWITCH("x86", "x86-64"), flag, NULL);
chip_options = aclGetChipOptions(tgtInfo);
@@ -43,13 +43,13 @@ ClBinary::FeatureCheckResult ClBinary::checkFeatures() {
((elf_target == EM_386) && (strcmp(LP64_SWITCH("x86", "x86-64"), "x86") != 0)) ||
((elf_target == EM_X86_64) && (strcmp(LP64_SWITCH("x86", "x86-64"), "x86-64") != 0))) {
LogError("Loading OCL CPU binary: different target");
return ERROR;
return fcERROR;
}
} else {
// BIF 2.0
if ((platform != amd::OclElf::CPU_PLATFORM) || ((target & elf_target) != elf_target)) {
LogError("Loading OCL CPU binary: different target");
return ERROR;
return fcERROR;
}
}
char* section;
@@ -64,11 +64,11 @@ ClBinary::FeatureCheckResult ClBinary::checkFeatures() {
if (elfIn_->getSection(amd::OclElf::LLVMIR, &section, &sz)) {
if ((section != NULL) && (sz > 0)) {
// hasDLL being false to force recompiling
RECOMPILE;
fcRECOMPILE;
}
}
}
return OK;
return fcOK;
}
bool ClBinary::loadX86(Program& program, std::string& dllName, bool& hasDLL) {
@@ -79,11 +79,11 @@ bool ClBinary::loadX86(Program& program, std::string& dllName, bool& hasDLL) {
dllName = tempName + "." WINDOWS_SWITCH("dll", MACOS_SWITCH("dyld", "so"));
switch (checkFeatures()) {
case ERROR:
case fcERROR:
return false;
case RECOMPILE:
case fcRECOMPILE:
return true;
case OK:
case fcOK:
// Fallthrough
break;
}
@@ -143,11 +143,11 @@ bool ClBinary::loadX86JIT(Program& program, bool& hasJITBinary) {
hasJITBinary = false;
switch (checkFeatures()) {
case ERROR:
case fcERROR:
return false;
case RECOMPILE:
case fcRECOMPILE:
return true;
case OK:
case fcOK:
// Fallthrough
break;
}