Skip to content

Commit 32fd3bc

Browse files
authored
[SYCL][E2E] Fix lit to use arch selection and l0 v2 adapter (#20839)
The fix allows to use of _v1 and _v2 to select the l0 adapter and the use of arch to select the GPU, eg.: `llvm-lit --param "sycl_devices=level_zero_v2:arch-intel_gpu_mtl_u"` Necessary to run tests on integrated GPU on system with another GPU --------- Signed-off-by: Mateusz P. Nowak <mateusz.p.nowak@intel.com>
1 parent 8c614ad commit 32fd3bc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

sycl/test-e2e/format.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ def get_extra_env(sycl_devices):
353353
"linux",
354354
"windows",
355355
"preview-breaking-changes-supported",
356+
"gpu",
356357
]:
357358
if cond_features in test.config.available_features:
358359
conditions[cond_features] = True

sycl/test-e2e/lit.cfg.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,12 +917,14 @@ def get_sycl_ls_verbose(sycl_device, env):
917917

918918
env = copy.copy(llvm_config.config.environment)
919919

920+
backend_for_selector = backend.replace("_v2", "").replace("_v1", "")
921+
920922
# Find all available devices under the backend
921-
env["ONEAPI_DEVICE_SELECTOR"] = backend + ":*"
923+
env["ONEAPI_DEVICE_SELECTOR"] = backend_for_selector + ":*"
922924

923925
detected_architectures = []
924926

925-
platform_devices = remove_level_zero_suffix(backend + ":*")
927+
platform_devices = backend_for_selector + ":*"
926928

927929
for line in get_sycl_ls_verbose(platform_devices, env).stdout.splitlines():
928930
if re.match(r" *Architecture:", line):
@@ -1114,6 +1116,13 @@ def get_sycl_ls_verbose(sycl_device, env):
11141116
features.update(device_family)
11151117

11161118
be, dev = sycl_device.split(":")
1119+
if dev.isdigit():
1120+
backend_devices = available_devices.get(be, "gpu")
1121+
if isinstance(backend_devices, tuple):
1122+
# arch-selection is typically used to select gpu device
1123+
dev = "gpu"
1124+
else:
1125+
dev = backend_devices
11171126
features.add(dev.replace("fpga", "accelerator"))
11181127
if "level_zero_v2" in full_name:
11191128
features.add("level_zero_v2_adapter")

0 commit comments

Comments
 (0)