From 3cc948278e98ac91be7079f4b1f184ca0246e335 Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Thu, 25 Apr 2024 19:47:18 +0100 Subject: [PATCH] SWDEV-449052 - Fix hipMemcpyParam2D when source or destination pitch is set to zero When source or destination pitch is set to zero in hip_Memcpy2D struct it should default to WidthInBytes + [src/dst]XInBytes Change-Id: Id57b53cab40ba72ced231258da9356554c4868c3 [ROCm/clr commit: 7a1e818c829b694695dd0ba3425fb34934d70097] --- projects/clr/hipamd/src/hip_conversions.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/clr/hipamd/src/hip_conversions.hpp b/projects/clr/hipamd/src/hip_conversions.hpp index 11fe66d363..b985f08782 100644 --- a/projects/clr/hipamd/src/hip_conversions.hpp +++ b/projects/clr/hipamd/src/hip_conversions.hpp @@ -626,7 +626,8 @@ HIP_MEMCPY3D getDrvMemcpy3DDesc(const hip_Memcpy2D& desc2D) { desc3D.srcHost = desc2D.srcHost; desc3D.srcDevice = desc2D.srcDevice; desc3D.srcArray = desc2D.srcArray; - desc3D.srcPitch = desc2D.srcPitch; + desc3D.srcPitch = desc2D.srcPitch ? desc2D.srcPitch + : (desc2D.srcXInBytes + desc2D.WidthInBytes); desc3D.srcHeight = 0; desc3D.dstXInBytes = desc2D.dstXInBytes; @@ -637,7 +638,8 @@ HIP_MEMCPY3D getDrvMemcpy3DDesc(const hip_Memcpy2D& desc2D) { desc3D.dstHost = desc2D.dstHost; desc3D.dstDevice = desc2D.dstDevice; desc3D.dstArray = desc2D.dstArray; - desc3D.dstPitch = desc2D.dstPitch; + desc3D.dstPitch = desc2D.dstPitch ? desc2D.dstPitch + : (desc2D.dstXInBytes + desc2D.WidthInBytes); desc3D.dstHeight = 0; desc3D.WidthInBytes = desc2D.WidthInBytes;