P4 to Git Change 1201783 by gandryey@gera-w8 on 2015/10/20 18:03:34

SWDEV-79151 - clenqueuereadImage is slow when using a pinned buffer and a row_picth!0
	- Add a check if the provided rowPitch is equal to the actual transfer width. SDMA doesn't support row/slice pitches, thus runtime still has to fall back to compute in other cases

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_memobj.cpp#78 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#120 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#122 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#92 edit


[ROCm/clr commit: 922e14c46d]
This commit is contained in:
foreman
2015-10-20 18:37:35 -04:00
rodzic ca83b79cff
commit 21014b2703
3 zmienionych plików z 24 dodań i 11 usunięć
@@ -938,6 +938,8 @@ KernelBlitManager::copyBufferToImage(
static const bool CopyRect = false;
// Flush DMA for ASYNC copy
static const bool FlushDMA = true;
size_t imgRowPitch = size[0] * gpuMem(dstMemory).elementSize();
size_t imgSlicePitch = imgRowPitch * size[1];
if (setup_.disableCopyBufferToImage_) {
result = DmaBlitManager::copyBufferToImage(
@@ -948,7 +950,9 @@ KernelBlitManager::copyBufferToImage(
}
// Check if buffer is in system memory with direct access
else if (gpuMem(srcMemory).isHostMemDirectAccess() &&
(rowPitch == 0) && (slicePitch == 0)) {
(((rowPitch == 0) && (slicePitch == 0)) ||
((rowPitch == imgRowPitch) &&
((slicePitch == 0) || (slicePitch == imgSlicePitch))))) {
// First attempt to do this all with DMA,
// but there are restriciton with older hardware
if (dev().settings().imageDMA_) {
@@ -1330,6 +1334,8 @@ KernelBlitManager::copyImageToBuffer(
static const bool CopyRect = false;
// Flush DMA for ASYNC copy
static const bool FlushDMA = true;
size_t imgRowPitch = size[0] * gpuMem(srcMemory).elementSize();
size_t imgSlicePitch = imgRowPitch * size[1];
if (setup_.disableCopyImageToBuffer_) {
result = HostBlitManager::copyImageToBuffer(
@@ -1340,7 +1346,9 @@ KernelBlitManager::copyImageToBuffer(
}
// Check if buffer is in system memory with direct access
else if (gpuMem(dstMemory).isHostMemDirectAccess() &&
(rowPitch == 0) && (slicePitch == 0)) {
(((rowPitch == 0) && (slicePitch == 0)) ||
((rowPitch == imgRowPitch) &&
((slicePitch == 0) || (slicePitch == imgSlicePitch))))) {
// First attempt to do this all with DMA,
// but there are restriciton with older hardware
if (dev().settings().imageDMA_) {