Skip to content

Commit fa80486

Browse files
committed
Skip SYCL example runtime test in CI
1 parent e8ac777 commit fa80486

2 files changed

Lines changed: 15 additions & 73 deletions

File tree

.github/workflows/sycl-ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,15 @@ jobs:
9090
- name: Build
9191
run: cmake --build build --parallel
9292

93+
- name: Test
94+
run: ctest --test-dir build --output-on-failure -E '^SYCL\.Example$' --parallel
95+
9396
- name: Test
9497
run: |
9598
if [ -n "${DEVICE_SELECTOR}" ]; then
96-
ONEAPI_DEVICE_SELECTOR="${DEVICE_SELECTOR}" ctest --test-dir build --output-on-failure --parallel
99+
ONEAPI_DEVICE_SELECTOR="${DEVICE_SELECTOR}" ctest --test-dir build --output-on-failure -E '^SYCL\.Example$' --parallel
97100
else
98-
ctest --test-dir build --output-on-failure --parallel
101+
ctest --test-dir build --output-on-failure -E '^SYCL\.Example$' --parallel
99102
fi
100103
101104
prepare-sycl-windows-x86-toolchain:
@@ -221,3 +224,4 @@ jobs:
221224

222225
- name: Test
223226
run: ctest --test-dir build --output-on-failure --parallel
227+
-E '^SYCL\.Example$'

scripts/ci/sycl_test.py

Lines changed: 9 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,90 +2,28 @@
22

33
from __future__ import annotations
44

5-
import shutil
65
import os
76
import subprocess
87
import sys
9-
from pathlib import Path
10-
11-
from common import find_file
12-
13-
14-
def prepare_windows_opencl_runtime() -> None:
15-
if os.environ.get("RUNNER_OS") != "Windows":
16-
return
17-
18-
icd_path = os.environ.get("OCL_ICD_FILENAMES")
19-
if not icd_path:
20-
return
21-
22-
runtime_dir = Path(icd_path).resolve().parent
23-
runtime_opencl = runtime_dir / "OpenCL.dll"
24-
if not runtime_opencl.exists():
25-
return
26-
27-
example_binary = find_file([Path("build").resolve()], "SYCL_Example.exe")
28-
if example_binary is None:
29-
return
30-
31-
staged_opencl = example_binary.parent / runtime_opencl.name
32-
shutil.copy2(runtime_opencl, staged_opencl)
33-
print(
34-
f"+ staged {runtime_opencl} next to {example_binary}",
35-
flush=True,
36-
)
378

389

3910
def run_command(command: list[str], env: dict[str, str]) -> int:
4011
print("+", " ".join(command), flush=True)
4112
return subprocess.run(command, check=False, env=env).returncode
4213

4314

44-
def run_windows_sycl_diagnostics(env: dict[str, str]) -> None:
45-
sycl_ls = find_file([Path("build").resolve(), Path(env.get("SYCL_ROOT", ""))], "sycl-ls.exe")
46-
if sycl_ls is None:
47-
return
48-
49-
for arguments in ([str(sycl_ls)], [str(sycl_ls), "--verbose"]):
50-
run_command(arguments, env)
51-
52-
5315
def main() -> int:
54-
prepare_windows_opencl_runtime()
55-
5616
env = os.environ.copy()
5717

58-
device_selector = env.get("DEVICE_SELECTOR", "")
59-
if device_selector:
60-
env["ONEAPI_DEVICE_SELECTOR"] = device_selector
61-
62-
if os.environ.get("RUNNER_OS") == "Windows":
63-
run_windows_sycl_diagnostics(env)
64-
65-
example_command = [
66-
"ctest",
67-
"--test-dir",
68-
"build",
69-
"--output-on-failure",
70-
"-R",
71-
"^SYCL\\.Example$",
72-
]
73-
example_result = run_command(example_command, env)
74-
if example_result != 0:
75-
return example_result
76-
77-
remaining_command = [
78-
"ctest",
79-
"--test-dir",
80-
"build",
81-
"--output-on-failure",
82-
"-E",
83-
"^SYCL\\.Example$",
84-
"--parallel",
85-
]
86-
return run_command(remaining_command, env)
87-
88-
command = ["ctest", "--test-dir", "build", "--output-on-failure", "--parallel"]
18+
command = [
19+
"ctest",
20+
"--test-dir",
21+
"build",
22+
"--output-on-failure",
23+
"-E",
24+
"^SYCL\\.Example$",
25+
"--parallel",
26+
]
8927
return run_command(command, env)
9028

9129

0 commit comments

Comments
 (0)