Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CopyImage verification for 1D/2D images #1791

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 40 additions & 19 deletions test_conformance/images/clCopyImage/test_copy_generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,32 +519,53 @@ int test_copy_image_generic( cl_context context, cl_command_queue queue, image_d
if( gDebugTrace )
log_info( " - Scanline verification...\n" );

size_t thirdDim;
size_t secondDim;
if (dstImageInfo->type == CL_MEM_OBJECT_IMAGE1D_ARRAY)
{
secondDim = dstImageInfo->arraySize;
thirdDim = 1;
}
else if (dstImageInfo->type == CL_MEM_OBJECT_IMAGE2D_ARRAY)
size_t thirdDim = 1;
size_t secondDim = 1;

switch (dstImageInfo->type)
{
secondDim = dstImageInfo->height;
if( gTestMipmaps )
secondDim = (dstImageInfo->height >> dst_lod) ? (dstImageInfo->height >> dst_lod):1;
thirdDim = dstImageInfo->arraySize;
case CL_MEM_OBJECT_IMAGE1D_ARRAY: {
secondDim = dstImageInfo->arraySize;
break;
}
case CL_MEM_OBJECT_IMAGE2D_ARRAY: {
secondDim = dstImageInfo->height;
thirdDim = dstImageInfo->arraySize;
break;
}
case CL_MEM_OBJECT_IMAGE3D: {
secondDim = dstImageInfo->height;
thirdDim = dstImageInfo->depth;
break;
}
case CL_MEM_OBJECT_IMAGE2D: {
secondDim = dstImageInfo->height;
break;
}
case CL_MEM_OBJECT_IMAGE1D: {
break;
}
default: {
log_error("ERROR: Unsupported Image type. \n");
return error;
break;
}
}
else
if (gTestMipmaps)
{
secondDim = dstImageInfo->height;
thirdDim = dstImageInfo->depth;
if( gTestMipmaps )
switch (dstImageInfo->type)
{
secondDim = (dstImageInfo->height >> dst_lod) ? (dstImageInfo->height >> dst_lod):1;
if(dstImageInfo->type == CL_MEM_OBJECT_IMAGE3D)
case CL_MEM_OBJECT_IMAGE3D:
thirdDim = (dstImageInfo->depth >> dst_lod) ? (dstImageInfo->depth >> dst_lod):1;
/* Fallthrough */
case CL_MEM_OBJECT_IMAGE2D:
case CL_MEM_OBJECT_IMAGE2D_ARRAY:
secondDim = (dstImageInfo->height >> dst_lod)
? (dstImageInfo->height >> dst_lod)
: 1;
break;
}
}

for( size_t z = 0; z < thirdDim; z++ )
{
for( size_t y = 0; y < secondDim; y++ )
Expand Down
Loading