P4 to Git Change 1361170 by wchau@wchau_WIN_OCL_LC on 2017/01/12 10:55:25

SWDEV-102698 - [OCL-LC-ROCm] Add code caching support to OpenCL program manager - resubmission of CL#1358063 with addition of PAL/LC support

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#149 edit
... //depot/stg/opencl/drivers/opencl/compiler/tools/Makefile#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#207 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#282 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/build/Makefile.pal#8 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#42 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#15 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#28 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile.oclrocm#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#34 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#51 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#264 edit


[ROCm/clr commit: c9781ce180]
This commit is contained in:
foreman
2017-01-12 11:03:31 -05:00
parent b1b8eef130
commit f899b79163
11 changed files with 330 additions and 17 deletions
@@ -300,7 +300,7 @@ bool NullDevice::init() {
bool isOnline = false;
//Check if the particular device is online
for (unsigned int i=0; i< devices.size(); i++) {
if (static_cast<NullDevice*>(devices[i])->deviceInfo_.hsaDeviceId_ ==
if (static_cast<NullDevice*>(devices[i])->deviceInfo_.hsaDeviceId_ ==
DeviceInfo[id].hsaDeviceId_){
isOnline = true;
}
@@ -592,6 +592,29 @@ Device::mapHSADeviceToOpenCLDevice(hsa_agent_t dev)
}
}
#if defined(WITH_LIGHTNING_COMPILER)
// create compilation object with cache support
int gfxipMajor = deviceInfo_.gfxipVersion_ / 100;
int gfxipMinor = deviceInfo_.gfxipVersion_ / 10 % 10;
int gfxipStepping = deviceInfo_.gfxipVersion_ % 10;
// Use compute capability as target (AMD:AMDGPU:major:minor:stepping)
// with dash as delimiter to be compatible with Windows directory name
std::ostringstream cacheTarget;
cacheTarget << "AMD-AMDGPU-" << gfxipMajor << "-" << gfxipMinor << "-" << gfxipStepping;
amd::CacheCompilation* compObj = new amd::CacheCompilation(cacheTarget.str(),
"_rocm",
OCL_CODE_CACHE_ENABLE,
OCL_CODE_CACHE_RESET);
if (!compObj) {
LogError("Unable to create cache compilation object!");
return false;
}
cacheCompilation_.reset(compObj);
#endif
return true;
}
@@ -1080,7 +1103,7 @@ Device::bindExternalDevice(
#else
if((flags&amd::Context::GLDeviceKhr)==0)
return false;
MesaInterop::MESA_INTEROP_KIND kind=MesaInterop::MESA_INTEROP_NONE;
MesaInterop::DisplayHandle display;
MesaInterop::ContextHandle context;