P4 to Git Change 1307417 by lmoriche@lmoriche_opencl_dev on 2016/08/26 01:38:31
SWDEV-94610 - Setup the (hidden) arguments for global_offset [x,y,z]. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#16 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#10 edit
This commit is contained in:
@@ -1024,7 +1024,7 @@ namespace roc {
|
||||
}
|
||||
|
||||
// for OpenCL default hidden kernel arguments assuming there is no printf
|
||||
size_t numHiddenKernelArgs = 0; // FIXME_lmoriche:3;
|
||||
size_t numHiddenKernelArgs = 3; // FIXME_Wilkin
|
||||
|
||||
// Fix the kernel name issue that causes string comparison does not work
|
||||
// due to an extra character at the end
|
||||
@@ -1040,7 +1040,7 @@ namespace roc {
|
||||
// TODO: remove the workaround
|
||||
// add 24 bytes for global offsets as workaround for LC reporting
|
||||
// excluded the hidden arguments
|
||||
kernargSegmentByteSize /* FIXME_lmoriche:+24*/,
|
||||
kernargSegmentByteSize + numHiddenKernelArgs * sizeof(size_t),
|
||||
kernargSegmentAlignment,
|
||||
numHiddenKernelArgs
|
||||
);
|
||||
|
||||
@@ -1498,6 +1498,7 @@ VirtualGPU::submitKernelInternal(
|
||||
|
||||
address argPtr = argBuffer;
|
||||
|
||||
#if !defined(WITH_LIGHTNING_COMPILER)
|
||||
// The HLC generates Kernenv arguments, first 3 are global offsets.
|
||||
const uint extraAargs = ((roc::Kernel*)devKernel)->extraArgumentsNum();
|
||||
for (uint j = 0; j < extraAargs; ++j) {
|
||||
@@ -1510,6 +1511,7 @@ VirtualGPU::submitKernelInternal(
|
||||
addArg(&argPtr, &offset, sizeof(void*)); //Should be uint32_t for small model and uint64_t for large!
|
||||
}
|
||||
}
|
||||
#endif // defined(WITH_LIGHTNING_COMPILER)
|
||||
|
||||
const amd::KernelSignature& signature = kernel.signature();
|
||||
const amd::KernelParameters& kernelParams = kernel.parameters();
|
||||
@@ -1625,6 +1627,26 @@ VirtualGPU::submitKernelInternal(
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(WITH_LIGHTNING_COMPILER)
|
||||
const uint extraAargs = ((roc::Kernel*)devKernel)->extraArgumentsNum();
|
||||
for (uint j = 0; j < extraAargs; ++j) {
|
||||
switch(j) {
|
||||
case 3: { // Printf buffer
|
||||
address bufferPtr = printfDbg()->dbgBuffer();
|
||||
addArg(&argPtr, &bufferPtr, sizeof(void*));
|
||||
break;
|
||||
}
|
||||
case 0: case 1: case 2: { // Global offsets
|
||||
const size_t offset = j < sizes.dimensions() ? sizes.offset()[j] : 0;
|
||||
addArg(&argPtr, &offset, sizeof(size_t));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
assert(!"Unknown hidden argument index");
|
||||
}
|
||||
}
|
||||
#endif // defined(WITH_LIGHTNING_COMPILER)
|
||||
|
||||
// Check there is no arguments' buffer overflow
|
||||
assert(argPtr <= argBuffer + gpuKernel.KernargSegmentByteSize());
|
||||
|
||||
|
||||
مرجع در شماره جدید
Block a user