Add NULL CL_MEM_HOST_PTR check for all flag combinations (#1850)

* Add NULL CL_MEM_HOST_PTR check for clGetMemObjectInfo

The spec requires implementations return NULL for CL_MEM_HOST_PTR
when the flags passed at memory object creation time do not contain
CL_MEM_USE_HOST_PTR

CTS was not checking this. Add the same check.

Fixes #1752

* Add NULL CL_MEM_HOST_PTR check for all flag combinations

As part of suggestions to #1801, add NULL CL_MEM_HOST_PTR
check for all flag combinations.

Fixes #1752

* Fix formatting issues
This commit is contained in:
niranjanjoshi121
2024-03-12 11:31:46 -05:00
committed by GitHub
parent 90cefbb38e
commit 6530ae45b5

View File

@@ -223,6 +223,12 @@ int test_get_buffer_info( cl_device_id deviceID, cl_context context, cl_command_
}
// Perform buffer object queries.
void *ptr;
TEST_MEM_OBJECT_PARAM(
bufferObject, CL_MEM_HOST_PTR, ptr,
((bufferFlags[i] & CL_MEM_USE_HOST_PTR) ? buffer : NULL),
"host pointer", "%p", void *)
cl_mem_object_type type;
TEST_MEM_OBJECT_PARAM( bufferObject, CL_MEM_TYPE, type, CL_MEM_OBJECT_BUFFER, "type", "%d", int )