From 7cb7a79db9ea48ed1c3fb40fedab68ed109c34e1 Mon Sep 17 00:00:00 2001 From: Michal Babej Date: Wed, 28 Aug 2024 19:39:18 +0300 Subject: [PATCH] generic_address_space: add check for program scope variables Skip the test if program scope variables are not supported. --- .../generic_address_space/main.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test_conformance/generic_address_space/main.cpp b/test_conformance/generic_address_space/main.cpp index a7897367ba..dabb4d0202 100644 --- a/test_conformance/generic_address_space/main.cpp +++ b/test_conformance/generic_address_space/main.cpp @@ -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,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;