Report actual image size being tested

# Conflicts:
#	test_conformance/images/clFillImage/test_fill_2D_array.cpp
This commit is contained in:
Kevin Petit
2019-07-31 12:16:19 +01:00
committed by Kévin Petit
parent 003f476024
commit 2b6b38eaba

View File

@@ -149,29 +149,28 @@ int test_fill_image_set_2D_array( cl_device_id device, cl_context context, cl_co
} }
imageInfo.slicePitch = imageInfo.rowPitch * (imageInfo.height + slicePadding); imageInfo.slicePitch = imageInfo.rowPitch * (imageInfo.height + slicePadding);
cl_ulong size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4;
// Loop until we get a size that a) will fit in the max alloc size and b) that an allocation of that // Loop until we get a size that a) will fit in the max alloc size and b) that an allocation of that
// image, the result array, plus offset arrays, will fit in the global ram space // image, the result array, plus offset arrays, will fit in the global ram space
while( size > maxAllocSize || ( size * 3 ) > memSize ) cl_ulong size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4;
{
if(imageInfo.arraySize == 1) while (size > maxAllocSize || (size * 3) > memSize) {
{ if (imageInfo.arraySize == 1) {
// ArraySize cannot be 0. // arraySize cannot be 0.
break; break;
} }
imageInfo.arraySize--; imageInfo.arraySize--;
size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4; size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4;
} }
while( size > maxAllocSize || ( size * 3 ) > memSize ) while (size > maxAllocSize || (size * 3) > memSize) {
{
imageInfo.height--; imageInfo.height--;
imageInfo.slicePitch = imageInfo.height * imageInfo.rowPitch; imageInfo.slicePitch = imageInfo.height * imageInfo.rowPitch;
size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4; size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4;
} }
log_info( "Testing %d x %d x %d\n", (int)sizes[ idx ][ 0 ], (int)sizes[ idx ][ 1 ], (int)sizes[ idx ][ 2 ] );
if ( gDebugTrace ) log_info( "Testing %d x %d x %d\n", (int)imageInfo.width, (int)imageInfo.height, (int)imageInfo.arraySize);
log_info( " at max size %d,%d,%d\n", (int)sizes[ idx ][ 0 ], (int)sizes[ idx ][ 1 ], (int)sizes[ idx ][ 2 ] );
if ( test_fill_image_2D_array( context, queue, &imageInfo, outputType, seed ) ) if ( test_fill_image_2D_array( context, queue, &imageInfo, outputType, seed ) )
return -1; return -1;
} }