From eeb1a4f7a9f538b302cb2db6c90e2f9e9d2941cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Widera?= Date: Thu, 25 Jan 2024 16:27:21 +0100 Subject: [PATCH] fix pitch usage With #245 the latest alpaka version was introduced in cupla. The alpaka pitch definition has changed with https://github.com/alpaka-group/alpaka/pull/2093. We forget to change the usage in #245. This PR handels the pitch correctly. --- src/memory.cpp | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 3b6e5f49..0ab4baac 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -280,9 +280,9 @@ inline namespace CUPLA_ACCELERATOR_NAMESPACE { const ::alpaka::Vec, cupla::MemSizeType> numBytes(height, width); - const ::alpaka::Vec, cupla::MemSizeType> dstPitch(dPitch * height, dPitch); + const ::alpaka::Vec, cupla::MemSizeType> dstPitch(dPitch, sizeof(uint8_t)); - const ::alpaka::Vec, cupla::MemSizeType> srcPitch(sPitch * height, sPitch); + const ::alpaka::Vec, cupla::MemSizeType> srcPitch(sPitch, sizeof(uint8_t)); auto& device(cupla::manager::Device::get().current()); @@ -387,23 +387,15 @@ inline namespace CUPLA_ACCELERATOR_NAMESPACE const ::alpaka::Vec, cupla::MemSizeType> offsetDst(p->dstPos.z, p->dstPos.y, p->dstPos.x); - const ::alpaka::Vec< - cupla::AlpakaDim<3u>, - cupla::MemSizeType> - dstPitch( - p->dstPtr.pitch * p->dstPtr.ysize - * (p->extent.depth + p->dstPos.z), // @todo: can't create z pitch, but is not needed by alpaka - p->dstPtr.pitch * p->dstPtr.ysize, - p->dstPtr.pitch); - - const ::alpaka::Vec< - cupla::AlpakaDim<3u>, - cupla::MemSizeType> - srcPitch( - p->srcPtr.pitch * p->srcPtr.ysize - * (p->extent.depth + p->srcPos.z), // @todo: can't create z pitch, but is not needed by alpaka - p->srcPtr.pitch * p->srcPtr.ysize, - p->srcPtr.pitch); + const ::alpaka::Vec, cupla::MemSizeType> dstPitch( + p->dstPtr.pitch * p->dstPtr.ysize, + p->dstPtr.pitch, + sizeof(uint8_t)); + + const ::alpaka::Vec, cupla::MemSizeType> srcPitch( + p->srcPtr.pitch * p->srcPtr.ysize, + p->srcPtr.pitch, + sizeof(uint8_t)); auto& device(cupla::manager::Device::get().current());