Skip to content

Commit

Permalink
generic_address_space: add check for program scope variables
Browse files Browse the repository at this point in the history
Skip the test if program scope variables are not supported.
  • Loading branch information
franz committed Aug 29, 2024
1 parent 32872d5 commit 7cb7a79
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test_conformance/generic_address_space/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -106,6 +107,21 @@ 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 MAX_GLOBAL_VARIABLE_SIZE value. "
"Program scope variable support is required");
return TEST_FAIL;
}

if (!max_gvar_size)
{
return TEST_SKIP;
}

}

return TEST_PASS;
Expand Down

0 comments on commit 7cb7a79

Please sign in to comment.