From 82508f709a518062917e27258c6086cfb0dfedae Mon Sep 17 00:00:00 2001 From: Ahmed Hesham <117350656+ahesham-arm@users.noreply.github.com> Date: Thu, 24 Jul 2025 18:43:03 +0100 Subject: [PATCH] Fix test_spir not checking for the required extension (#2454) `clGetDeviceInfo` should fail with `CL_INVALID_VALUE` when queried for `CL_DEVICE_SPIR_VERSIONS` on devices that do not claim to support the extension that provides it, `cl_khr_spir`. Following this change, the test is skipped instead of failing on devices that do not support `cl_khr_spir`. Signed-off-by: Ahmed Hesham --- test_conformance/spir/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test_conformance/spir/main.cpp b/test_conformance/spir/main.cpp index 77754a2f..95e8c00f 100644 --- a/test_conformance/spir/main.cpp +++ b/test_conformance/spir/main.cpp @@ -6911,12 +6911,13 @@ int main (int argc, const char* argv[]) cl_device_id device = get_platform_device(device_type, choosen_device_index, choosen_platform_index); printDeviceHeader(device); + REQUIRE_EXTENSION("cl_khr_spir"); + std::vector versions; get_spir_version(device, versions); - if (!is_extension_available(device, "cl_khr_spir") - || (std::find(versions.begin(), versions.end(), Version{ 1, 2 }) - == versions.end())) + if (std::find(versions.begin(), versions.end(), Version{ 1, 2 }) + == versions.end()) { log_info("Spir extension version 1.2 is not supported by the device\n"); return 0;