From bd3af873ec472b2a8d939c08ec28a8a5c5ad03ea Mon Sep 17 00:00:00 2001 From: foreman Date: Thu, 17 Jan 2019 22:11:38 -0500 Subject: [PATCH] P4 to Git Change 1732253 by asalmanp@asalmanp-ocl-stg on 2019/01/17 21:45:23 SWDEV-132899 - [OCL][GFX10] 70 subtests of Conformance Mipmaps (clCopyImage) test failed for image type 1Darray This is the follow up for CL#1517501 copyImage1DA blit kernel uses image2d_array_t type for src/dst images. On gx10, num of arrays/layers is expected in Z component for a 2Darray image so a swap is required for 1Darray images when we use 2Darray image for the image copy. The copyImage1DA has code for swapping z and y components as follows: if (srcOrigin.w != 0) { coordsSrc.z = coordsSrc.y; coordsSrc.y = 0; } if (dstOrigin.w != 0) { coordsDst.z = coordsDst.y; coordsDst.y = 0; } So to use this path force the w component to 1 for src and dst images on gfx10 if image type is 1Darray. ReviewRequestURL = http://ocltc.amd.com/reviews/r/16538/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#28 edit --- rocclr/runtime/device/pal/palblit.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rocclr/runtime/device/pal/palblit.cpp b/rocclr/runtime/device/pal/palblit.cpp index 3a5d3c2385..524979ee97 100644 --- a/rocclr/runtime/device/pal/palblit.cpp +++ b/rocclr/runtime/device/pal/palblit.cpp @@ -1569,10 +1569,18 @@ bool KernelBlitManager::copyImage(device::Memory& srcMemory, device::Memory& dst // Program source origin cl_int srcOrg[4] = {(cl_int)srcOrigin[0], (cl_int)srcOrigin[1], (cl_int)srcOrigin[2], 0}; + if ((gpuMem(srcMemory).desc().topology_ == CL_MEM_OBJECT_IMAGE1D_ARRAY) && + dev().settings().gfx10Plus_) { + srcOrg[3] = 1; + } setArgument(kernels_[blitType], 2, sizeof(srcOrg), srcOrg); // Program destinaiton origin cl_int dstOrg[4] = {(cl_int)dstOrigin[0], (cl_int)dstOrigin[1], (cl_int)dstOrigin[2], 0}; + if ((gpuMem(dstMemory).desc().topology_ == CL_MEM_OBJECT_IMAGE1D_ARRAY) && + dev().settings().gfx10Plus_) { + dstOrg[3] = 1; + } setArgument(kernels_[blitType], 3, sizeof(dstOrg), dstOrg); cl_int copySize[4] = {(cl_int)size[0], (cl_int)size[1], (cl_int)size[2], 0};