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:
Nikhil Joshi
2020-12-17 19:26:12 +05:30
parent 21ebaf2625
commit 49fa049f9b
10 changed files with 88 additions and 44 deletions

View File

@@ -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 )
{