From 741816f873eaf2ac5b0cbef2c5bbc63c2822483a Mon Sep 17 00:00:00 2001 From: foreman Date: Wed, 31 Aug 2016 22:44:50 -0400 Subject: [PATCH] P4 to Git Change 1309526 by lmoriche@lmoriche_opencl_dev on 2016/08/31 22:39:22 SWDEV-94610 - Use the metadata to set the correct size for pointer arguments. Pointers to different address spaces may be of different sizes. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#11 edit --- rocclr/runtime/device/rocm/rocvirtual.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rocclr/runtime/device/rocm/rocvirtual.cpp b/rocclr/runtime/device/rocm/rocvirtual.cpp index 2fea3d5f56..cc7c6317b3 100644 --- a/rocclr/runtime/device/rocm/rocvirtual.cpp +++ b/rocclr/runtime/device/rocm/rocvirtual.cpp @@ -1522,9 +1522,10 @@ VirtualGPU::submitKernelInternal( const_address srcArgPtr = parameters + signature.at(i).offset_; if (arg->type_ == HSAIL_ARGTYPE_POINTER ) { - const size_t size = sizeof(void*); + const size_t size = arg->size_; if (arg->addrQual_ == HSAIL_ADDRESS_LOCAL) { - ldsUsage = amd::alignUp(ldsUsage, arg->alignment_); //!< do we need this? + // Align the LDS on the alignment requirement of type pointed to + ldsUsage = amd::alignUp(ldsUsage, arg->alignment_); addArg(&argPtr, &ldsUsage, size); ldsUsage += *reinterpret_cast(srcArgPtr); continue;