mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-22 15:19:02 +00:00
Pass the right flags to the tests that create images to ensure valid usage. Fixes issue #330 Signed-off-by: James Morrissey <james.morrissey@arm.com> Co-authored-by: Alessandro Navone <alessandro.navone@arm.com>
This commit is contained in:
committed by
GitHub
parent
993447a74a
commit
5bd85b7384
@@ -15,9 +15,14 @@
|
||||
//
|
||||
#include "../testBase.h"
|
||||
|
||||
extern int test_get_image_info_single( cl_context context, cl_command_queue queue, image_descriptor *imageInfo, MTdata d );
|
||||
extern int test_get_image_info_single(cl_context context,
|
||||
cl_command_queue queue,
|
||||
image_descriptor *imageInfo, MTdata d,
|
||||
cl_mem_flags flags);
|
||||
|
||||
int test_get_image_info_3D( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format )
|
||||
int test_get_image_info_3D(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, cl_image_format *format,
|
||||
cl_mem_flags flags)
|
||||
{
|
||||
size_t maxWidth, maxHeight, maxDepth;
|
||||
cl_ulong maxAllocSize, memSize;
|
||||
@@ -25,6 +30,16 @@ int test_get_image_info_3D( cl_device_id device, cl_context context, cl_command_
|
||||
RandomSeed seed( gRandomSeed );
|
||||
size_t pixelSize;
|
||||
|
||||
if ((flags != CL_MEM_READ_ONLY)
|
||||
&& !is_extension_available(device, "cl_khr_3d_image_writes"))
|
||||
{
|
||||
log_info("-----------------------------------------------------\n");
|
||||
log_info("This device does not support cl_khr_3d_image_writes.\n"
|
||||
"Skipping 3d image write test.\n");
|
||||
log_info("-----------------------------------------------------\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
imageInfo.type = CL_MEM_OBJECT_IMAGE3D;
|
||||
imageInfo.format = format;
|
||||
pixelSize = get_pixel_size( imageInfo.format );
|
||||
@@ -53,7 +68,8 @@ int test_get_image_info_3D( cl_device_id device, cl_context context, cl_command_
|
||||
{
|
||||
if( gDebugTrace )
|
||||
log_info( " at size %d,%d,%d\n", (int)imageInfo.width, (int)imageInfo.height, (int)imageInfo.depth );
|
||||
int ret = test_get_image_info_single( context, queue, &imageInfo, seed );
|
||||
int ret = test_get_image_info_single(
|
||||
context, queue, &imageInfo, seed, flags);
|
||||
if( ret )
|
||||
return -1;
|
||||
}
|
||||
@@ -79,7 +95,8 @@ int test_get_image_info_3D( cl_device_id device, cl_context context, cl_command_
|
||||
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( " at max size %d,%d,%d\n", (int)sizes[ idx ][ 0 ], (int)sizes[ idx ][ 1 ], (int)sizes[ idx ][ 2 ] );
|
||||
if( test_get_image_info_single( context, queue, &imageInfo, seed ) )
|
||||
if (test_get_image_info_single(context, queue, &imageInfo, seed,
|
||||
flags))
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -115,7 +132,8 @@ int test_get_image_info_3D( cl_device_id device, cl_context context, cl_command_
|
||||
|
||||
if( gDebugTrace )
|
||||
log_info( " at size %d,%d,%d (pitch %d,%d) out of %d,%d,%d\n", (int)imageInfo.width, (int)imageInfo.height, (int)imageInfo.depth, (int)imageInfo.rowPitch, (int)imageInfo.slicePitch, (int)maxWidth, (int)maxHeight, (int)maxDepth );
|
||||
int ret = test_get_image_info_single( context, queue, &imageInfo, seed );
|
||||
int ret = test_get_image_info_single(context, queue, &imageInfo,
|
||||
seed, flags);
|
||||
if( ret )
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user