fix generic_address_space, command_buffer_event_sync, test_compiler and images/test_1D_buffer (#2062)

fixes several issues:

* `generic_address_space` test: add check for program scope variables.
The test uses both generic AS and program-scope variables, however it
only checked the generic-AS presence in `clGetDeviceInfo`.
* `compiler/test_compiler_defines_for_extensions.cpp`: add
`cl_khr_command_buffer_multi_device` to the list of recognized
extensions
* `command_buffer_event_sync.cpp`: add delays for testing
`clSetEventCallback` - according to specification, these can be executed
asynchronously (in a separate thread) by the OpenCL implementation,
hence the event callback is not quaranteed to be called before
`clFinish()` returns. Existing test `events/test_callbacks.cpp` also
waits for callback with loops of usleep.
* `images/kernel_image_methods/test_1D_buffer.cpp`: fix allocation size
being too small for the 1D buffer backing the image

---------

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
This commit is contained in:
Michal Babej
2024-10-01 19:26:39 +03:00
committed by GitHub
parent 97cf4c7e25
commit 2be73b2be1
3 changed files with 33 additions and 1 deletions

View File

@@ -92,7 +92,8 @@ test_status InitCL(cl_device_id device) {
if (version >= Version(3, 0))
{
cl_int error;
cl_bool support_generic;
cl_bool support_generic = CL_FALSE;
size_t max_gvar_size = 0;
error = clGetDeviceInfo(device, CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT,
sizeof(support_generic), &support_generic, NULL);
@@ -106,6 +107,20 @@ test_status InitCL(cl_device_id device) {
{
return TEST_SKIP;
}
error = clGetDeviceInfo(device, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE,
sizeof(max_gvar_size), &max_gvar_size, NULL);
if (error != CL_SUCCESS)
{
print_error(error,
"Unable to query CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE.");
return TEST_FAIL;
}
if (!max_gvar_size)
{
return TEST_SKIP;
}
}
return TEST_PASS;