P4 to Git Change 1358063 by wchau@wchau_OCL_boltzmann on 2017/01/03 16:44:42

SWDEV-102698 - [OCL-LC-ROCm] Add code caching support to OpenCL program manager

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#146 edit
... //depot/stg/opencl/drivers/opencl/compiler/tools/Makefile#20 edit
... //depot/stg/opencl/drivers/opencl/runtime/build/Makefile.runtime#65 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#205 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#280 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile.oclrocm#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#25 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#49 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#17 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.hpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#261 edit
This commit is contained in:
foreman
2017-01-03 16:56:06 -05:00
parent b48cac624d
commit b9916d35f4
9 changed files with 336 additions and 26 deletions
+25 -2
View File
@@ -296,7 +296,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;
}
@@ -588,6 +588,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",
hsaSettings->enableCodeCache_,
hsaSettings->resetCodeCache_);
if (!compObj) {
LogError("Unable to create cache compilation object!");
return false;
}
cacheCompilation_.reset(compObj);
#endif
return true;
}
@@ -1076,7 +1099,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;