From dc93a360790baf0b71e97be4b1dc65dd4a03e359 Mon Sep 17 00:00:00 2001 From: Pietro Ghiglio Date: Sat, 22 Jun 2024 05:41:45 +0200 Subject: [PATCH] [SYCL][E2e] Optionally allow unknown architectures in e2e (#14254) https://github.com/intel/llvm/pull/13976 adds support for using the `Architecture` output of `sycl-ls` when configuring `e2e` tests. This PR adds an opt-in option to allow configuring `e2e` tests when the architecture is `unknown`. --- sycl/test-e2e/CMakeLists.txt | 3 +++ sycl/test-e2e/lit.cfg.py | 9 +++++---- sycl/test-e2e/lit.site.cfg.py.in | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sycl/test-e2e/CMakeLists.txt b/sycl/test-e2e/CMakeLists.txt index b838d89e0786d..c8b096315a8d6 100644 --- a/sycl/test-e2e/CMakeLists.txt +++ b/sycl/test-e2e/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.20.0) message("Configuring SYCL End-to-End Tests") +option(SYCL_E2E_LIT_ALLOW_UNKNOWN_ARCH + "Allow unknown architectures when configuring e2e tests" Off) + if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) project(sycl-e2e-test-suite CXX) set(SYCL_TEST_E2E_STANDALONE TRUE) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 9129e806ce248..9a1676da29bb7 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -753,11 +753,12 @@ "Architectures for {}: {}".format(sycl_device, ", ".join(architectures)) ) if len(architectures) != 1 or "unknown" in architectures: - lit_config.error( - "Cannot detect architecture for {}\nstdout:\n{}\nstderr:\n{}".format( - sycl_device, sp.stdout, sp.stderr + if not config.allow_unknown_arch: + lit_config.error( + "Cannot detect architecture for {}\nstdout:\n{}\nstderr:\n{}".format( + sycl_device, sp.stdout, sp.stderr + ) ) - ) architectures = set() aspect_features = set("aspect-" + a for a in aspects) diff --git a/sycl/test-e2e/lit.site.cfg.py.in b/sycl/test-e2e/lit.site.cfg.py.in index f11f9e8356371..ae7dd6dfdbe7e 100644 --- a/sycl/test-e2e/lit.site.cfg.py.in +++ b/sycl/test-e2e/lit.site.cfg.py.in @@ -43,6 +43,7 @@ config.vulkan_lib = "@Vulkan_LIBRARY@" config.vulkan_found = "@Vulkan_FOUND@" config.run_launcher = lit_config.params.get('run_launcher', "@SYCL_E2E_RUN_LAUNCHER@") +config.allow_unknown_arch = "@SYCL_E2E_LIT_ALLOW_UNKNOWN_ARCH@" import lit.llvm lit.llvm.initialize(lit_config, config)