mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-22 07:09:03 +00:00
Handle NULL hostptr in conformance image tests
As per the spec, clCreateBuffer and clCreateImage return CL_INVALID_HOST_PTR if host_ptr is NULL and CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR are set in flags or if host_ptr is not NULL but CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR are not set in flags." Host pointer should be NULL when USE/COPY_HOST_PTR is not set in flags.
This commit is contained in:
@@ -1360,11 +1360,10 @@ int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel ke
|
||||
{
|
||||
// Note: if ALLOC_HOST_PTR is used, the driver allocates memory that can be accessed by the host, but otherwise
|
||||
// it works just as if no flag is specified, so we just do the same thing either way
|
||||
unprotImage = create_image_2d( context,
|
||||
image_read_write_flags | gMemFlagsToUse,
|
||||
imageInfo->format,
|
||||
imageInfo->width, imageInfo->height, ( gEnablePitch ? imageInfo->rowPitch : 0 ),
|
||||
imageValues, &error );
|
||||
unprotImage = create_image_2d(
|
||||
context, image_read_write_flags | gMemFlagsToUse,
|
||||
imageInfo->format, imageInfo->width, imageInfo->height,
|
||||
(gEnablePitch ? imageInfo->rowPitch : 0), NULL, &error);
|
||||
}
|
||||
if( error != CL_SUCCESS )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user