From 540d1175c7ff6ebf34548440c08c6ae4f2efa233 Mon Sep 17 00:00:00 2001 From: Jeremy Kemp Date: Fri, 27 Mar 2020 12:16:17 +0000 Subject: [PATCH] Generic Address Space: Skip test on unsupported devices. (#708) * Generic Address Space: Skip test on unsupported devices. Where a device does not have to support this test, skip it. * CI: Added USE_CL_EXPERIMENTAL to the CI build(s). --- .../generic_address_space/main.cpp | 23 +++++++++++++++++++ travis.sh | 1 + 2 files changed, 24 insertions(+) diff --git a/test_conformance/generic_address_space/main.cpp b/test_conformance/generic_address_space/main.cpp index 058e4609..298f4d4f 100644 --- a/test_conformance/generic_address_space/main.cpp +++ b/test_conformance/generic_address_space/main.cpp @@ -70,11 +70,34 @@ const int test_num = ARRAY_SIZE( test_list ); test_status InitCL(cl_device_id device) { auto version = get_device_cl_version(device); auto expected_min_version = Version(2, 0); + if (version < expected_min_version) { version_expected_info("Test", expected_min_version.to_string().c_str(), version.to_string().c_str()); return TEST_SKIP; } + +#ifdef CL_EXPERIMENTAL + if (version > Version(2,2)) + { + cl_int error; + cl_bool support_generic; + + error = clGetDeviceInfo(device, CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT, + sizeof(support_generic), &support_generic, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get generic address space support"); + return TEST_FAIL; + } + + if (!support_generic) + { + return TEST_SKIP; + } + } +#endif + return TEST_PASS; } diff --git a/travis.sh b/travis.sh index 9fa0f75c..3c691d8a 100755 --- a/travis.sh +++ b/travis.sh @@ -63,6 +63,7 @@ cmake -DCL_INCLUDE_DIR=${TOP}/OpenCL-Headers \ -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=./bin \ -DOPENCL_LIBRARIES="-lOpenCL -lpthread" \ + -DUSE_CL_EXPERIMENTAL=ON \ .. make -j2