P4 to Git Change 1083967 by gandryey@gera-dev-w7 on 2014/10/03 11:20:24
ECR #304775 - Fix for BUG#10330. - Add an optimized version for unaligned buffer copy Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/blitcl.cpp#7 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#111 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsablit.cpp#9 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsablit.cpp#5 edit
This commit is contained in:
@@ -2513,7 +2513,30 @@ KernelBlitManager::copyBuffer(
|
||||
}
|
||||
}
|
||||
|
||||
size.c[0] /= CopyBuffAlignment[i];
|
||||
cl_uint remain;
|
||||
if (blitType == BlitCopyBufferAligned) {
|
||||
size.c[0] /= CopyBuffAlignment[i];
|
||||
}
|
||||
else {
|
||||
if (dev().settings().ciPlus_) {
|
||||
remain = size[0] % 4;
|
||||
size.c[0] /= 4;
|
||||
size.c[0] += 1;
|
||||
}
|
||||
else {
|
||||
// Check if offsets are aligned
|
||||
aligned = ((srcOrigin[0] % sizeof(uint32_t)) == 0);
|
||||
aligned &= ((dstOrigin[0] % sizeof(uint32_t)) == 0);
|
||||
if (aligned) {
|
||||
remain = size[0] % 4;
|
||||
size.c[0] /= 4;
|
||||
size.c[0] += 1;
|
||||
}
|
||||
else {
|
||||
remain = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Program the dispatch dimensions
|
||||
localWorkSize = 256;
|
||||
@@ -2539,6 +2562,9 @@ KernelBlitManager::copyBuffer(
|
||||
cl_int alignment = CopyBuffAlignment[i];
|
||||
setArgument(kernels_[blitType], 5, sizeof(alignment), &alignment);
|
||||
}
|
||||
else {
|
||||
setArgument(kernels_[blitType], 5, sizeof(remain), &remain);
|
||||
}
|
||||
|
||||
// Create ND range object for the kernel's execution
|
||||
amd::NDRangeContainer ndrange(1,
|
||||
|
||||
Reference in New Issue
Block a user