Revert "Fix Read/WriteBuffer for unaligned offsets"

This reverts commit 6ea863e440.

Change-Id: Ib58cfe4cffc022b1514c42131914eb2fe64fcbe0
This commit is contained in:
Pawel Wilma
2018-11-27 09:51:11 +01:00
committed by sys_ocldev
parent 4c1e3c60fa
commit 71f6524197
6 changed files with 9 additions and 150 deletions

View File

@@ -84,16 +84,9 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBuffer(
BuiltInOwnershipWrapper builtInLock(builder, this->context);
void *dstPtr = ptr;
void *alignedDstPtr = dstPtr;
size_t dstPtrOffset = 0;
if (!isAligned<4>(dstPtr)) {
alignedDstPtr = alignDown(dstPtr, 4);
dstPtrOffset = ptrDiff(dstPtr, alignedDstPtr);
}
MemObjSurface bufferSurf(buffer);
HostPtrSurface hostPtrSurf(alignedDstPtr, size + dstPtrOffset);
HostPtrSurface hostPtrSurf(dstPtr, size);
Surface *surfaces[] = {&bufferSurf, &hostPtrSurf};
if (size != 0) {
@@ -101,13 +94,11 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBuffer(
if (!status) {
return CL_OUT_OF_RESOURCES;
}
hostPtrSurf.getAllocation()->allocationOffset = dstPtrOffset;
dstPtr = reinterpret_cast<void *>(hostPtrSurf.getAllocation()->getGpuAddressToPatch());
}
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
dc.dstPtr = alignedDstPtr;
dc.dstOffset = {dstPtrOffset, 0, 0};
dc.dstPtr = dstPtr;
dc.srcMemObj = buffer;
dc.srcOffset = {offset, 0, 0};
dc.size = {size, 0, 0};

View File

@@ -83,15 +83,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
BuiltInOwnershipWrapper builtInLock(builder, this->context);
void *srcPtr = const_cast<void *>(ptr);
void *alignedSrcPtr = srcPtr;
size_t srcPtrOffset = 0;
if (!isAligned<4>(srcPtr)) {
alignedSrcPtr = alignDown(srcPtr, 4);
srcPtrOffset = ptrDiff(srcPtr, alignedSrcPtr);
}
HostPtrSurface hostPtrSurf(alignedSrcPtr, size + srcPtrOffset, true);
HostPtrSurface hostPtrSurf(srcPtr, size, true);
MemObjSurface bufferSurf(buffer);
Surface *surfaces[] = {&bufferSurf, &hostPtrSurf};
@@ -100,13 +93,11 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
if (!status) {
return CL_OUT_OF_RESOURCES;
}
hostPtrSurf.getAllocation()->allocationOffset = srcPtrOffset;
srcPtr = reinterpret_cast<void *>(hostPtrSurf.getAllocation()->getGpuAddressToPatch());
}
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
dc.srcPtr = alignedSrcPtr;
dc.srcOffset = {srcPtrOffset, 0, 0};
dc.srcPtr = srcPtr;
dc.dstMemObj = buffer;
dc.dstOffset = {offset, 0, 0};
dc.size = {size, 0, 0};