Skip to content

Commit 2980a81

Browse files
committed
Add AdaptiveCpp Linux arm SYCL job
1 parent 349d964 commit 2980a81

3 files changed

Lines changed: 117 additions & 32 deletions

File tree

.github/workflows/sycl-ci.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ concurrency:
1111
env:
1212
INTEL_LLVM_TAG: nightly-2026-03-17
1313
INTEL_OPENCL_CPU_RUNTIME_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ad824c04-01c8-4ae5-b5e8-164a04f67609/w_opencl_runtime_p_2025.3.1.762.exe
14+
ADAPTIVECPP_TAG: v25.10.0
1415

1516
jobs:
1617
build-sycl-x86:
@@ -68,13 +69,16 @@ jobs:
6869
- name: Test
6970
run: ONEAPI_DEVICE_SELECTOR="${DEVICE_SELECTOR}" ctest --test-dir build --output-on-failure --parallel
7071

71-
build-sycl-macos-arm64:
72-
name: macos-arm64 / ${{ matrix.build_type }}
73-
runs-on: macos-15
72+
build-sycl-adaptivecpp-arm64:
73+
name: ${{ matrix.platform }} / ${{ matrix.build_type }}
74+
runs-on: ${{ matrix.platform == 'linux-arm64' && 'ubuntu-24.04-arm' || 'macos-15' }}
7475
timeout-minutes: 360
7576
strategy:
7677
fail-fast: true
7778
matrix:
79+
platform:
80+
- linux-arm64
81+
- macos-arm64
7882
build_type:
7983
- Debug
8084
- Release
@@ -94,11 +98,11 @@ jobs:
9498
- name: Setup ccache
9599
uses: hendrikmuhs/ccache-action@v1.2
96100
with:
97-
key: ccache-${{ github.job }}-${{ matrix.build_type }}
101+
key: ccache-${{ github.job }}-${{ matrix.platform }}-${{ matrix.build_type }}
98102
max-size: 2G
99103

100-
- name: Install macOS prerequisites
101-
run: python3 ./scripts/ci/sycl_macos_setup.py
104+
- name: Install AdaptiveCpp prerequisites
105+
run: python3 ./scripts/ci/sycl_adaptivecpp_setup.py
102106

103107
- name: Configure
104108
run: python3 ./scripts/ci/sycl_configure.py "${{ matrix.build_type }}" "${ITLABAI_ENABLE_OPENCV_APPS}"
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/usr/bin/env python3
2+
3+
from __future__ import annotations
4+
5+
from pathlib import Path
6+
7+
from common import append_path, capture, prepend_env_path, require_env, run, write_env
8+
9+
10+
def set_common_env(prefix: str, clang_path: str, clangxx_path: str) -> None:
11+
write_env("ITLABAI_CC", clang_path)
12+
write_env("ITLABAI_CXX", clangxx_path)
13+
write_env("ITLABAI_CMAKE_PREFIX_PATH", prefix)
14+
write_env("ITLABAI_SYCL_IMPLEMENTATION", "AdaptiveCpp")
15+
write_env("ITLABAI_ENABLE_OPENCV_APPS", "ON")
16+
write_env("ACPP_TARGETS", "omp.library-only")
17+
append_path(f"{prefix}/bin")
18+
19+
20+
def setup_macos() -> None:
21+
run(["brew", "install", "adaptivecpp"])
22+
23+
adaptivecpp_prefix = capture(["brew", "--prefix", "adaptivecpp"])
24+
clang_path = capture(["xcrun", "--find", "clang"])
25+
clangxx_path = capture(["xcrun", "--find", "clang++"])
26+
27+
set_common_env(adaptivecpp_prefix, clang_path, clangxx_path)
28+
29+
30+
def setup_linux() -> None:
31+
run(["sudo", "apt-get", "update"])
32+
run(
33+
[
34+
"sudo",
35+
"apt-get",
36+
"install",
37+
"-y",
38+
"build-essential",
39+
"clang-18",
40+
"cmake",
41+
"git",
42+
"libboost-context-dev",
43+
"libboost-fiber-dev",
44+
"libboost-filesystem-dev",
45+
"libboost-system-dev",
46+
"libboost-test-dev",
47+
"libclang-18-dev",
48+
"libomp-18-dev",
49+
"llvm-18-dev",
50+
"python3",
51+
]
52+
)
53+
54+
runner_temp = Path(require_env("RUNNER_TEMP"))
55+
source_dir = runner_temp / "AdaptiveCpp"
56+
build_dir = runner_temp / "AdaptiveCpp-build"
57+
install_dir = runner_temp / "adaptivecpp-install"
58+
tag = require_env("ADAPTIVECPP_TAG")
59+
60+
run(
61+
[
62+
"git",
63+
"clone",
64+
"--branch",
65+
tag,
66+
"--depth",
67+
"1",
68+
"https://github.com/AdaptiveCpp/AdaptiveCpp.git",
69+
str(source_dir),
70+
]
71+
)
72+
run(
73+
[
74+
"cmake",
75+
"-S",
76+
str(source_dir),
77+
"-B",
78+
str(build_dir),
79+
"-G",
80+
"Ninja",
81+
"-DCMAKE_BUILD_TYPE=Release",
82+
f"-DCMAKE_INSTALL_PREFIX={install_dir}",
83+
"-DCMAKE_C_COMPILER=clang-18",
84+
"-DCMAKE_CXX_COMPILER=clang++-18",
85+
"-DLLVM_DIR=/usr/lib/llvm-18/lib/cmake/llvm",
86+
"-DClang_DIR=/usr/lib/llvm-18/lib/cmake/clang",
87+
]
88+
)
89+
run(["cmake", "--build", str(build_dir), "--target", "install", "--parallel"])
90+
91+
set_common_env(str(install_dir), "/usr/bin/clang-18", "/usr/bin/clang++-18")
92+
prepend_env_path("LD_LIBRARY_PATH", f"{install_dir}/lib")
93+
prepend_env_path("LD_LIBRARY_PATH", "/usr/lib/llvm-18/lib")
94+
95+
96+
def main() -> None:
97+
runner_os = require_env("RUNNER_OS")
98+
if runner_os == "macOS":
99+
setup_macos()
100+
elif runner_os == "Linux":
101+
setup_linux()
102+
else:
103+
raise SystemExit(f"Unsupported RUNNER_OS for AdaptiveCpp setup: {runner_os}")
104+
105+
106+
if __name__ == "__main__":
107+
main()

scripts/ci/sycl_macos_setup.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)