P4 to Git Change 1607329 by jatang@jatang_win_pal_lc on 2018/09/18 10:34:41

SWDEV-148809 - Device Enqueue on LC/PAL.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#109 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#66 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#71 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#28 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#124 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#55 edit


[ROCm/clr commit: 41facdb089]
This commit is contained in:
foreman
2018-09-18 10:42:05 -04:00
parent 4b9a58b312
commit ebe30e5da9
7 changed files with 55 additions and 23 deletions
@@ -421,6 +421,26 @@ bool LightningKernel::init(amd::hsa::loader::Symbol* symbol) {
workGroupInfo_.compileVecTypeHint_ = kernelMD->mAttrs.mVecTypeHint.c_str();
}
if (!kernelMD->mAttrs.mRuntimeHandle.empty()) {
hsa_agent_t agent;
agent.handle = 1;
amd::hsa::loader::Symbol* rth_symbol;
// Get the runtime handle symbol GPU address
rth_symbol = prog_.GetSymbol(const_cast<char*>(kernelMD->mAttrs.mRuntimeHandle.c_str()),
const_cast<hsa_agent_t*>(&agent));
uint64_t symbol_address;
rth_symbol->GetInfo(HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ADDRESS, &symbol_address);
// Copy the kernel_object pointer to the runtime handle symbol GPU address
const Memory& codeSegGpu = prog_.codeSegGpu();
uint64_t offset = symbol_address - codeSegGpu.vmAddress();
uint64_t kernel_object = gpuAqlCode();
VirtualGPU* gpu = codeSegGpu.dev().xferQueue();
codeSegGpu.writeRawData(*gpu, offset, 8, &kernel_object, true);
}
// Copy wavefront size
workGroupInfo_.wavefrontSize_ = dev().info().wavefrontWidth_;