mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 16:29:03 +00:00
Proposed fix for bug 11537
This commit is contained in:
committed by
Kévin Petit
parent
627c180a31
commit
003f476024
@@ -149,7 +149,26 @@ 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
|
||||||
|
// image, the result array, plus offset arrays, will fit in the global ram space
|
||||||
|
while( size > maxAllocSize || ( size * 3 ) > memSize )
|
||||||
|
{
|
||||||
|
if(imageInfo.arraySize == 1)
|
||||||
|
{
|
||||||
|
// ArraySize cannot be 0.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
imageInfo.arraySize--;
|
||||||
|
size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
while( size > maxAllocSize || ( size * 3 ) > memSize )
|
||||||
|
{
|
||||||
|
imageInfo.height--;
|
||||||
|
imageInfo.slicePitch = imageInfo.height * imageInfo.rowPitch;
|
||||||
|
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 ] );
|
log_info( "Testing %d x %d x %d\n", (int)sizes[ idx ][ 0 ], (int)sizes[ idx ][ 1 ], (int)sizes[ idx ][ 2 ] );
|
||||||
if ( gDebugTrace )
|
if ( gDebugTrace )
|
||||||
log_info( " at max size %d,%d,%d\n", (int)sizes[ idx ][ 0 ], (int)sizes[ idx ][ 1 ], (int)sizes[ idx ][ 2 ] );
|
log_info( " at max size %d,%d,%d\n", (int)sizes[ idx ][ 0 ], (int)sizes[ idx ][ 1 ], (int)sizes[ idx ][ 2 ] );
|
||||||
|
|||||||
Reference in New Issue
Block a user