Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.

Commit 17e57cf

Browse files
committed
Skip unsupported Linux SYCL example device
1 parent 2e21875 commit 17e57cf

2 files changed

Lines changed: 82 additions & 7 deletions

File tree

.github/workflows/sycl-ci.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959

6060
- name: Prepare platform settings
6161
run: python3 ./scripts/ci/sycl_x86_setup.py "${{ matrix.platform }}"
62+
env:
63+
ITLABAI_CI_PLATFORM: ${{ matrix.platform }}
6264

6365
- name: Configure
6466
run: python3 ./scripts/ci/sycl_configure.py "${{ matrix.build_type }}" "${ITLABAI_ENABLE_OPENCV_APPS}"
@@ -67,12 +69,9 @@ jobs:
6769
run: cmake --build build --parallel
6870

6971
- name: Test
70-
run: |
71-
if [ -n "${DEVICE_SELECTOR}" ]; then
72-
ONEAPI_DEVICE_SELECTOR="${DEVICE_SELECTOR}" ctest --test-dir build --output-on-failure --parallel
73-
else
74-
ctest --test-dir build --output-on-failure --parallel
75-
fi
72+
run: python3 ./scripts/ci/sycl_test.py
73+
env:
74+
ITLABAI_CI_PLATFORM: ${{ matrix.platform }}
7675

7776
build-sycl-adaptivecpp-arm64:
7877
name: ${{ matrix.platform }} / ${{ matrix.build_type }}
@@ -108,6 +107,8 @@ jobs:
108107

109108
- name: Install AdaptiveCpp prerequisites
110109
run: python3 ./scripts/ci/sycl_adaptivecpp_setup.py
110+
env:
111+
ITLABAI_CI_PLATFORM: ${{ matrix.platform }}
111112

112113
- name: Configure
113114
run: python3 ./scripts/ci/sycl_configure.py "${{ matrix.build_type }}" "${ITLABAI_ENABLE_OPENCV_APPS}"
@@ -116,4 +117,6 @@ jobs:
116117
run: cmake --build build --parallel
117118

118119
- name: Test
119-
run: ctest --test-dir build --output-on-failure --parallel
120+
run: python3 ./scripts/ci/sycl_test.py
121+
env:
122+
ITLABAI_CI_PLATFORM: ${{ matrix.platform }}

scripts/ci/sycl_test.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env python3
2+
3+
from __future__ import annotations
4+
5+
import os
6+
import subprocess
7+
import sys
8+
from pathlib import Path
9+
10+
from common import main_error, repo_root, require_env, run
11+
12+
13+
def run_capture(command: list[str], *, env: dict[str, str] | None = None) -> subprocess.CompletedProcess[str]:
14+
print("+", " ".join(command), flush=True)
15+
return subprocess.run(
16+
command,
17+
check=False,
18+
text=True,
19+
capture_output=True,
20+
env=env,
21+
)
22+
23+
24+
def main() -> None:
25+
platform = require_env("ITLABAI_CI_PLATFORM")
26+
27+
base_env = os.environ.copy()
28+
device_selector = os.environ.get("DEVICE_SELECTOR", "")
29+
if device_selector:
30+
base_env["ONEAPI_DEVICE_SELECTOR"] = device_selector
31+
os.environ["ONEAPI_DEVICE_SELECTOR"] = device_selector
32+
33+
if platform != "linux-x86_64":
34+
run(["ctest", "--test-dir", "build", "--output-on-failure", "--parallel"])
35+
return
36+
37+
run(
38+
[
39+
"ctest",
40+
"--test-dir",
41+
"build",
42+
"--output-on-failure",
43+
"--parallel",
44+
"-E",
45+
"^SYCL\\.Example$",
46+
]
47+
)
48+
49+
example_path = repo_root() / "build" / "bin" / "SYCL_Example"
50+
result = run_capture([str(example_path)], env=base_env)
51+
52+
if result.returncode == 0:
53+
if result.stdout:
54+
print(result.stdout, end="")
55+
if result.stderr:
56+
print(result.stderr, end="", file=sys.stderr)
57+
return
58+
59+
combined_output = f"{result.stdout}{result.stderr}"
60+
if "No device of requested type available" in combined_output:
61+
print("Skipping SYCL.Example on linux-x86_64: no supported SYCL device on this runner.")
62+
return
63+
64+
if result.stdout:
65+
print(result.stdout, end="")
66+
if result.stderr:
67+
print(result.stderr, end="", file=sys.stderr)
68+
raise SystemExit(result.returncode)
69+
70+
71+
if __name__ == "__main__":
72+
main()

0 commit comments

Comments
 (0)