From 44761fe89b64001620b285a75c92fd5c3eb472eb Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Wed, 29 Nov 2023 16:31:03 -0500 Subject: [PATCH] SWDEV-434298 - Add destination offset The end pointer in copy buffer requires destination offset Change-Id: I01f2967144f741761fd2ce3244fd8d04564d986f --- rocclr/device/pal/palblit.cpp | 4 ++-- rocclr/device/rocm/rocblit.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rocclr/device/pal/palblit.cpp b/rocclr/device/pal/palblit.cpp index ee76c33927..abe6490fdb 100644 --- a/rocclr/device/pal/palblit.cpp +++ b/rocclr/device/pal/palblit.cpp @@ -2314,8 +2314,8 @@ bool KernelBlitManager::copyBuffer(device::Memory& srcMemory, device::Memory& ds setArgument(kernels_[kBlitType], 5, sizeof(remainder), &remainder); setArgument(kernels_[kBlitType], 6, sizeof(aligned_size), &aligned_size); - // End pointer is the aligned copy size - uint64_t end_ptr = dstMemory.virtualAddress() + sizeIn[0] - remainder; + // End pointer is the aligned copy size and destination offset + uint64_t end_ptr = dstMemory.virtualAddress() + dstOffset + sizeIn[0] - remainder; setArgument(kernels_[kBlitType], 7, sizeof(end_ptr), &end_ptr); uint32_t next_chunk = globalWorkSize; diff --git a/rocclr/device/rocm/rocblit.cpp b/rocclr/device/rocm/rocblit.cpp index 7a949b020e..9ea2bf2b55 100644 --- a/rocclr/device/rocm/rocblit.cpp +++ b/rocclr/device/rocm/rocblit.cpp @@ -2335,8 +2335,9 @@ bool KernelBlitManager::copyBuffer(device::Memory& srcMemory, device::Memory& ds setArgument(kernels_[kBlitType], 5, sizeof(remainder), &remainder); setArgument(kernels_[kBlitType], 6, sizeof(aligned_size), &aligned_size); - // End pointer is the aligned copy size - uint64_t end_ptr = dstMemory.virtualAddress() + sizeIn[0] - remainder; + // End pointer is the aligned copy size and destination offset + uint64_t end_ptr = dstMemory.virtualAddress() + dstOffset + sizeIn[0] - remainder; + setArgument(kernels_[kBlitType], 7, sizeof(end_ptr), &end_ptr); uint32_t next_chunk = globalWorkSize;