diff --git a/sycl/test-e2e/ESIMD/accessor_local.cpp b/sycl/test-e2e/ESIMD/accessor_local.cpp index 8f97084fa7f3f..8e65fe5da055b 100644 --- a/sycl/test-e2e/ESIMD/accessor_local.cpp +++ b/sycl/test-e2e/ESIMD/accessor_local.cpp @@ -1,3 +1,4 @@ +// REQUIRES-INTEL-DRIVER: lin: 27202, win: 101.4677 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // This test verifies usage of local_accessor methods operator[] @@ -112,12 +113,6 @@ int main() { std::cout << "Running on " << Dev.get_info() << ", Local memory size available : " << DeviceSLMSize << std::endl; - if (!isGPUDriverGE(Q, esimd_test::GPUDriverOS::LinuxAndWindows, "27202", - "101.4677")) { - std::cout << "Skipped. The test requires GPU driver 1.3.27202 or newer.\n"; - return 0; - } - uint32_t LocalRange = 16; uint32_t GlobalRange = LocalRange * 2; // 2 groups. diff --git a/sycl/test-e2e/ESIMD/api/slm_gather_scatter_heavy.cpp b/sycl/test-e2e/ESIMD/api/slm_gather_scatter_heavy.cpp index d57383d68379a..c15c6f2ccbb49 100644 --- a/sycl/test-e2e/ESIMD/api/slm_gather_scatter_heavy.cpp +++ b/sycl/test-e2e/ESIMD/api/slm_gather_scatter_heavy.cpp @@ -9,7 +9,12 @@ // RUN: %{run} %t.out // // UNSUPPORTED: esimd_emulator - +// +// GPU driver had an error in handling of SLM aligned block_loads/stores, +// which has been fixed only in "1.3.26816", and in win/opencl version going +// _after_ 101.4575. +// REQUIRES-INTEL-DRIVER: lin: 26816, win: 101.4576 +// // The test checks functionality of the slm gather/scatter ESIMD intrinsics. // It varies element type, vector length and stride of gather/scatter operation. // For simplicity of calculations, workgroup size (number of work items same @@ -445,15 +450,6 @@ int main() { auto dev = q.get_device(); esimd_test::printTestLabel(q); - // GPU driver had an error in handling of SLM aligned block_loads/stores, - // which has been fixed only in "1.3.26816", and in win/opencl version going - // _after_ 101.4575. - if (!esimd_test::isGPUDriverGE(q, esimd_test::GPUDriverOS::LinuxAndWindows, - "26816", "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26816 or newer.\n"; - return 0; - } - bool passed = true; passed &= test_vl1(q); passed &= test(q); diff --git a/sycl/test-e2e/ESIMD/assert.cpp b/sycl/test-e2e/ESIMD/assert.cpp index fef8cb01abf1c..9b1200161d29a 100644 --- a/sycl/test-e2e/ESIMD/assert.cpp +++ b/sycl/test-e2e/ESIMD/assert.cpp @@ -1,3 +1,4 @@ +// REQUIRES-INTEL-DRIVER: lin: 26816, win: 101.4576 // REQUIRES: linux && level_zero // RUN: %{build} -DSYCL_FALLBACK_ASSERT=1 -o %t.out @@ -19,15 +20,6 @@ using namespace sycl; int main() { queue Q(esimd_test::ESIMDSelector, esimd_test::createExceptionHandler()); esimd_test::printTestLabel(Q); - if (!esimd_test::isGPUDriverGE(Q, esimd_test::GPUDriverOS::LinuxAndWindows, - "26816", "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26816 or newer.\n"; - // Additionally, print expected messages to pass FileCheck checks below. - std::cerr << "Assert called: Id != 31 && \"assert message31\"\n"; - std::cerr << "assert.cpp, Line 29, Function auto main()::(anonymous class)" - << "::operator()(id<1>) const, gid(31, 0, 0), lid(3, 0, 0)\n"; - return 0; - } try { Q.parallel_for(range<1>{100}, [=](id<1> Id) SYCL_ESIMD_KERNEL { diff --git a/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke.cpp b/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke.cpp index c146d891b2002..b8d2665bcc319 100644 --- a/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke.cpp +++ b/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // This test checks DWORD local accessor atomic operations. //===----------------------------------------------------------------------===// +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // diff --git a/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_cmpxchg.cpp b/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_cmpxchg.cpp index ebee95120b091..837b059e90e71 100644 --- a/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_cmpxchg.cpp +++ b/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_cmpxchg.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // This test checks DWORD local accessor cmpxchg atomic operations. //===----------------------------------------------------------------------===// +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // diff --git a/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_cmpxchg_scalar_off.cpp b/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_cmpxchg_scalar_off.cpp index a5521df8a517a..d71229b844dd1 100644 --- a/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_cmpxchg_scalar_off.cpp +++ b/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_cmpxchg_scalar_off.cpp @@ -9,6 +9,7 @@ // This test checks DWORD local accessor cmpxchg atomic operations with scalar // offset. //===----------------------------------------------------------------------===// +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // diff --git a/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_scalar_off.cpp b/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_scalar_off.cpp index 903abd2b0aeed..0e63d0280c3d8 100644 --- a/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_scalar_off.cpp +++ b/sycl/test-e2e/ESIMD/dword_local_accessor_atomic_smoke_scalar_off.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // This test checks DWORD local accessor atomic operations with scalar offset. //===----------------------------------------------------------------------===// +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // diff --git a/sycl/test-e2e/ESIMD/ext_math.cpp b/sycl/test-e2e/ESIMD/ext_math.cpp index 337ef996e3346..a5dd98de8c6aa 100644 --- a/sycl/test-e2e/ESIMD/ext_math.cpp +++ b/sycl/test-e2e/ESIMD/ext_math.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// +// REQUIRES-INTEL-DRIVER: lin: 27012, win: 101.4576 // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} // RUN: %{build} -fsycl-device-code-split=per_kernel %{mathflags} -o %t.out // RUN: %{run} %t.out @@ -480,13 +481,6 @@ int main(void) { queue Q(esimd_test::ESIMDSelector, esimd_test::createExceptionHandler()); esimd_test::printTestLabel(Q); auto Dev = Q.get_device(); -#ifndef SKIP_NEW_GPU_DRIVER_VERSION_CHECK - if (!esimd_test::isGPUDriverGE(Q, esimd_test::GPUDriverOS::LinuxAndWindows, - "27012", "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.27012 or newer.\n"; - return 0; - } -#endif bool Pass = true; #ifdef TEST_IEEE_DIV_REM diff --git a/sycl/test-e2e/ESIMD/ext_math_saturate.cpp b/sycl/test-e2e/ESIMD/ext_math_saturate.cpp index d8886de015ca5..07090c22e11f6 100644 --- a/sycl/test-e2e/ESIMD/ext_math_saturate.cpp +++ b/sycl/test-e2e/ESIMD/ext_math_saturate.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// +// REQUIRES-INTEL-DRIVER: lin: 27012, win: 101.4576 // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} // RUN: %{build} -fsycl-device-code-split=per_kernel %{mathflags} -o %t.out // RUN: %{run} %t.out diff --git a/sycl/test-e2e/ESIMD/local_accessor_block_load_store.cpp b/sycl/test-e2e/ESIMD/local_accessor_block_load_store.cpp index 922925ec7dc66..52f2895b2bd12 100644 --- a/sycl/test-e2e/ESIMD/local_accessor_block_load_store.cpp +++ b/sycl/test-e2e/ESIMD/local_accessor_block_load_store.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// +// REQUIRES-INTEL-DRIVER: lin: 27202, win: 101.4677 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // This test verifies usage of block_load/block_store for local_accessor. @@ -98,12 +99,6 @@ int main() { auto DeviceSLMSize = Dev.get_info(); esimd_test::printTestLabel(Q, "Local memory size available", DeviceSLMSize); - if (!isGPUDriverGE(Q, esimd_test::GPUDriverOS::LinuxAndWindows, "27202", - "101.4677")) { - std::cout << "Skipped. The test requires GPU driver 1.3.27202 or newer.\n"; - return 0; - } - constexpr size_t Align4 = 4; constexpr size_t Align8 = 8; constexpr size_t Align16 = 16; diff --git a/sycl/test-e2e/ESIMD/local_accessor_copy_to_from.cpp b/sycl/test-e2e/ESIMD/local_accessor_copy_to_from.cpp index 82814b153f50e..76349077a5585 100644 --- a/sycl/test-e2e/ESIMD/local_accessor_copy_to_from.cpp +++ b/sycl/test-e2e/ESIMD/local_accessor_copy_to_from.cpp @@ -5,6 +5,8 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// +// REQUIRES-INTEL-DRIVER: lin: 27202, win: 101.4677 +// // RUN: %{build} -o %t.out // RUN: %{run} %t.out // @@ -100,11 +102,6 @@ int main() { auto dev = q.get_device(); std::cout << "Running on " << dev.get_info() << "\n"; - if (!isGPUDriverGE(q, esimd_test::GPUDriverOS::LinuxAndWindows, "27202", - "101.4677")) { - std::cout << "Skipped. The test requires GPU driver 1.3.27202 or newer.\n"; - return 0; - } bool passed = true; passed &= test(q); diff --git a/sycl/test-e2e/ESIMD/local_accessor_gather_scatter.cpp b/sycl/test-e2e/ESIMD/local_accessor_gather_scatter.cpp index 183e0e626e3c3..a3262ae764dc9 100644 --- a/sycl/test-e2e/ESIMD/local_accessor_gather_scatter.cpp +++ b/sycl/test-e2e/ESIMD/local_accessor_gather_scatter.cpp @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // @@ -100,12 +101,6 @@ int main(void) { auto dev = q.get_device(); std::cout << "Running on " << dev.get_info() << "\n"; - if (!isGPUDriverGE(q, esimd_test::GPUDriverOS::LinuxAndWindows, "26690", - "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26690 or newer.\n"; - return 0; - } - bool passed = true; passed &= test(q); passed &= test(q); diff --git a/sycl/test-e2e/ESIMD/local_accessor_gather_scatter_rgba.cpp b/sycl/test-e2e/ESIMD/local_accessor_gather_scatter_rgba.cpp index 3947dfdd872f5..c221ade130d37 100644 --- a/sycl/test-e2e/ESIMD/local_accessor_gather_scatter_rgba.cpp +++ b/sycl/test-e2e/ESIMD/local_accessor_gather_scatter_rgba.cpp @@ -8,6 +8,7 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out // UNSUPPORTED: esimd_emulator +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 // The test checks functionality of the gather_rgba/scatter_rgba local // accessor-based ESIMD intrinsics. @@ -185,12 +186,6 @@ int main(void) { std::cout << "Running on " << dev.get_info() << "\n"; - if (!isGPUDriverGE(q, esimd_test::GPUDriverOS::LinuxAndWindows, "26690", - "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26690 or newer.\n"; - return 0; - } - bool passed = true; passed &= test(q); passed &= test(q); diff --git a/sycl/test-e2e/ESIMD/lsc/local_accessor_atomic_smoke.cpp b/sycl/test-e2e/ESIMD/lsc/local_accessor_atomic_smoke.cpp index cb9e1229e4a56..93cd248f7a68e 100644 --- a/sycl/test-e2e/ESIMD/lsc/local_accessor_atomic_smoke.cpp +++ b/sycl/test-e2e/ESIMD/lsc/local_accessor_atomic_smoke.cpp @@ -8,6 +8,7 @@ // This test checks local accessor atomic operations. //===----------------------------------------------------------------------===// // REQUIRES: gpu-intel-pvc +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // @@ -623,11 +624,6 @@ int main(void) { auto dev = q.get_device(); std::cout << "Running on " << dev.get_info() << "\n"; - if (!isGPUDriverGE(q, esimd_test::GPUDriverOS::LinuxAndWindows, "26690", - "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26690 or newer.\n"; - return 0; - } bool passed = true; #ifndef CMPXCHG_TEST diff --git a/sycl/test-e2e/ESIMD/lsc/lsc_local_accessor_block_load_store.cpp b/sycl/test-e2e/ESIMD/lsc/lsc_local_accessor_block_load_store.cpp index 18e1dc3d27b2d..8eccf878f449e 100644 --- a/sycl/test-e2e/ESIMD/lsc/lsc_local_accessor_block_load_store.cpp +++ b/sycl/test-e2e/ESIMD/lsc/lsc_local_accessor_block_load_store.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// // REQUIRES: gpu-intel-pvc +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // @@ -97,11 +98,6 @@ int main() { auto DeviceSLMSize = Dev.get_info(); std::cout << "Running on " << Dev.get_info() << ", Local memory size available : " << DeviceSLMSize << std::endl; - if (!isGPUDriverGE(Q, esimd_test::GPUDriverOS::LinuxAndWindows, "26690", - "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26690 or newer.\n"; - return 0; - } constexpr uint32_t LocalRange = 16; constexpr uint32_t GlobalRange = LocalRange * 2; // 2 groups. diff --git a/sycl/test-e2e/ESIMD/lsc/lsc_local_accessor_gather_scatter.cpp b/sycl/test-e2e/ESIMD/lsc/lsc_local_accessor_gather_scatter.cpp index 3fe8c2b46e80d..8bedf0c7f3348 100644 --- a/sycl/test-e2e/ESIMD/lsc/lsc_local_accessor_gather_scatter.cpp +++ b/sycl/test-e2e/ESIMD/lsc/lsc_local_accessor_gather_scatter.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// // REQUIRES: gpu-intel-pvc +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 // RUN: %{build} -o %t.out // RUN: %{run} %t.out // @@ -101,11 +102,6 @@ int main(void) { auto dev = q.get_device(); std::cout << "Running on " << dev.get_info() << "\n"; - if (!isGPUDriverGE(q, esimd_test::GPUDriverOS::LinuxAndWindows, "26690", - "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26690 or newer.\n"; - return 0; - } bool passed = true; passed &= test(q); diff --git a/sycl/test-e2e/ESIMD/slm_block_load_store.cpp b/sycl/test-e2e/ESIMD/slm_block_load_store.cpp index 1eb776df0e61e..045330e208658 100644 --- a/sycl/test-e2e/ESIMD/slm_block_load_store.cpp +++ b/sycl/test-e2e/ESIMD/slm_block_load_store.cpp @@ -9,6 +9,12 @@ // RUN: %{run} %t.out // // UNSUPPORTED: esimd_emulator +// +// GPU driver had an error in handling of SLM aligned block_loads/stores, +// which has been fixed only in "1.3.26816", and in win/opencl version going +// _after_ 101.4575. +// REQUIRES-INTEL-DRIVER: lin: 26816, win: 101.4576 +// // Even though the driver we use in CI is now new enough so this test doesn't // skip itself, it still fails. Temporary XFAIL-ing it while it is being // investigated. @@ -103,15 +109,6 @@ int main() { auto DeviceSLMSize = Dev.get_info(); esimd_test::printTestLabel(Q, "Local memory size available", DeviceSLMSize); - // GPU driver had an error in handling of SLM aligned block_loads/stores, - // which has been fixed only in "1.3.26816", and in win/opencl version going - // _after_ 101.4575. - if (!esimd_test::isGPUDriverGE(Q, esimd_test::GPUDriverOS::LinuxAndWindows, - "26816", "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26816 or newer.\n"; - return 0; - } - constexpr size_t Align4 = 4; constexpr size_t Align8 = 8; constexpr size_t Align16 = 16; diff --git a/sycl/test-e2e/InvokeSimd/Regression/slm_load_store.cpp b/sycl/test-e2e/InvokeSimd/Regression/slm_load_store.cpp index 69f520bd097f0..4f53a9ab80f96 100644 --- a/sycl/test-e2e/InvokeSimd/Regression/slm_load_store.cpp +++ b/sycl/test-e2e/InvokeSimd/Regression/slm_load_store.cpp @@ -1,3 +1,8 @@ +// GPU driver had an error in handling of SLM aligned block_loads/stores, +// which has been fixed only in "1.3.26816", and in win/opencl version going +// _after_ 101.4575. +// REQUIRES-INTEL-DRIVER: lin: 26816, win: 101.4576 +// // RUN: %{build} -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr -o %t.out // RUN: env IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %{run} %t.out // @@ -79,14 +84,6 @@ int main(void) { std::cout << "Running on " << Dev.get_info() << std::endl; - // GPU driver had an error in handling of SLM aligned block_loads/stores, - // which has been fixed only in "1.3.26816", and in win/opencl version going - // _after_ 101.4575. - if (!isGPUDriverGE(Q, GPUDriverOS::LinuxAndWindows, "26816", "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26816 or newer.\n"; - return 0; - } - auto DeviceSLMSize = Dev.get_info(); std::cout << "Local Memory Size: " << DeviceSLMSize << std::endl; diff --git a/sycl/test-e2e/InvokeSimd/Spec/simd_size/simd8.cpp b/sycl/test-e2e/InvokeSimd/Spec/simd_size/simd8.cpp index 7c5be5deba4ba..8212db8a68f86 100644 --- a/sycl/test-e2e/InvokeSimd/Spec/simd_size/simd8.cpp +++ b/sycl/test-e2e/InvokeSimd/Spec/simd_size/simd8.cpp @@ -1,6 +1,8 @@ // Test not intended to run on PVC // UNSUPPORTED: gpu-intel-pvc // +// REQUIRES-INTEL-DRIVER: lin: 26690, win: 101.4576 +// // Check that full compilation works: // RUN: %{build} -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr -o %t.out // RUN: env IGC_VCSaveStackCallLinkage=1 IGC_VCDirectCallsOnly=1 %{run} %t.out @@ -26,11 +28,6 @@ int main(void) { std::cout << "Running on " << dev.get_info() << "\n"; - if (!isGPUDriverGE(q, GPUDriverOS::LinuxAndWindows, "26690", "101.4576")) { - std::cout << "Skipped. The test requires GPU driver 1.3.26690 or newer.\n"; - return 0; - } - bool passed = true; // simd_size 8 diff --git a/sycl/test-e2e/format.py b/sycl/test-e2e/format.py index 5e9498402f96d..c6f7c64efe677 100644 --- a/sycl/test-e2e/format.py +++ b/sycl/test-e2e/format.py @@ -2,8 +2,14 @@ import lit.formats from lit.BooleanExpression import BooleanExpression +from lit.TestRunner import ( + ParserKind, + IntegratedTestKeywordParser, + # parseIntegratedTestScript, +) import os +import re def get_triple(test, backend): if backend == 'ext_oneapi_cuda': @@ -17,6 +23,35 @@ def get_triple(test, backend): return 'native_cpu' return 'spir64' +def parse_min_intel_driver_req(line_number, line, output): + """ +Driver version looks like this for Intel devices: + Linux/L0: [1.3.26370] + Linux/opencl: [23.22.26370.18] + Windows/L0: [1.3.26370] + Windows/opencl: [31.0.101.4502] +Only "26370" and "101.4502" are interesting for us for the purpose of detecting +if the driver has required changes or not. As such we refer to the former +(5-digit) as "lin" format and as "win" for the latter. +""" + if not output: + output = {} + + lin = re.search('lin: *([0-9]{5})', line) + if lin: + if 'lin' in output: + raise ValueError('Multiple entries for "lin" version') + output['lin'] = int(lin.group(1)) + + win = re.search('win: *([0-9]{3}\.[0-9]{4})', line) + if win: + if 'win' in output: + raise ValueError('Multiple entries for "win" version') + # Return "win" version as (101, 4502) to ease later comparison. + output['win'] = tuple(map(int, win.group(1).split('.'))) + + return output + class SYCLEndToEndTest(lit.formats.ShTest): def parseTestScript(self, test): """This is based on lit.TestRunner.parseIntegratedTestScript but we @@ -25,7 +60,13 @@ def parseTestScript(self, test): # Parse the test sources and extract test properties try: - parsed = lit.TestRunner._parseKeywords(test.getSourcePath(), require_script=True) + parsed = lit.TestRunner._parseKeywords( + test.getSourcePath(), + additional_parsers=[ + IntegratedTestKeywordParser("REQUIRES-INTEL-DRIVER:", + ParserKind.CUSTOM, + parse_min_intel_driver_req)], + require_script=True) except ValueError as e: return lit.Test.Result(Test.UNRESOLVED, str(e)) script = parsed['RUN:'] or [] @@ -38,6 +79,8 @@ def parseTestScript(self, test): test.unsupported += test.config.unsupported_features test.unsupported += parsed['UNSUPPORTED:'] or [] + test.intel_driver_req = parsed['REQUIRES-INTEL-DRIVER:'] + return script def getMatchedFromList(self, features, alist): @@ -57,6 +100,16 @@ def select_devices_for_test(self, test): if self.getMatchedFromList(features, test.unsupported): continue + driver_ok = True + if test.intel_driver_req: + for fmt in ['lin', 'win']: + if (fmt in test.intel_driver_req + and fmt in test.config.intel_driver_ver[d] + and test.config.intel_driver_ver[d][fmt] < test.intel_driver_req[fmt]): + driver_ok = False + if not driver_ok: + continue + devices.append(d) if len(devices) <= 1: diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index c4469ab369e98..62093772043b1 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -386,6 +386,9 @@ # That has to be executed last so that all device-independent features have been # discovered already. config.sycl_dev_features = {} + +# Version of the driver for a given device. Empty for non-Intel devices. +config.intel_driver_ver = {} for sycl_device in config.sycl_devices: env = copy.copy(llvm_config.config.environment) env['ONEAPI_DEVICE_SELECTOR'] = sycl_device @@ -409,11 +412,25 @@ dev_aspects = [] dev_sg_sizes = [] + # See format.py's parse_min_intel_driver_req for explanation. + is_intel_driver = False + intel_driver_ver = {} for line in sp.stdout.splitlines(): - if re.search(r'^ *Aspects *:', line): + if re.match(r' *Vendor *: Intel\(R\) Corporation', line): + is_intel_driver = True + if re.match(r' *Driver *:', line): + _, driver_str = line.split(':', 1) + driver_str = driver_str.strip() + lin = re.match(r'[0-9]{1,2}\.[0-9]{1,2}\.([0-9]{5})', driver_str) + if lin: + intel_driver_ver['lin'] = int(lin.group(1)) + win = re.match(r'[0-9]{1,2}\.[0-9]{1,2}\.([0-9]{3})\.([0-9]{4})', driver_str) + if win: + intel_driver_ver['win'] = (int(win.group(1)), int(win.group(2))) + if re.match(r' *Aspects *:', line): _, aspects_str = line.split(':', 1) dev_aspects.append(aspects_str.strip().split(' ')) - if re.search(r'^ *info::device::sub_group_sizes:', line): + if re.match(r' *info::device::sub_group_sizes:', line): # str.removeprefix isn't universally available... sg_sizes_str = line.strip().replace('info::device::sub_group_sizes: ', '') dev_sg_sizes.append(sg_sizes_str.strip().split(' ')) @@ -448,6 +465,10 @@ features.add(be.replace('ext_intel_', '').replace('ext_oneapi_', '')) config.sycl_dev_features[sycl_device] = features.union(config.available_features) + if is_intel_driver: + config.intel_driver_ver[sycl_device] = intel_driver_ver + else: + config.intel_driver_ver[sycl_device] = {} # Set timeout for a single test try: