-
Notifications
You must be signed in to change notification settings - Fork 2
229 lines (202 loc) · 7.02 KB
/
Copy pathsycl-ci.yml
File metadata and controls
229 lines (202 loc) · 7.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
name: SYCL CI
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ADAPTIVECPP_TAG: v25.10.0
ADAPTIVECPP_CACHE_VERSION: v4
ACPP_TARGETS: omp.library-only
jobs:
prepare-sycl-toolchain:
name: prepare ${{ matrix.platform }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 180
strategy:
fail-fast: true
matrix:
platform:
- linux-x86_64
- linux-arm64
- windows-x86_64
include:
- platform: linux-x86_64
runner: ubuntu-latest
- platform: linux-arm64
runner: ubuntu-24.04-arm
- platform: windows-x86_64
runner: windows-2022
steps:
- uses: actions/checkout@v4
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ github.job }}-${{ matrix.platform }}
max-size: 4G
- name: Restore or save AdaptiveCpp toolchain cache
id: sycl-toolchain-cache
uses: actions/cache@v4
with:
path: |
${{ runner.temp }}/AdaptiveCpp
${{ runner.temp }}/AdaptiveCpp-build
${{ runner.temp }}/adaptivecpp-install
${{ runner.temp }}/archives
key: sycl-toolchain-${{ matrix.platform }}-${{ env.ADAPTIVECPP_TAG }}-${{ env.ADAPTIVECPP_CACHE_VERSION }}
- name: Prepare SYCL toolchain
uses: ./.github/actions/setup-sycl-toolchain
with:
phase: prepare
cache-hit: ${{ steps.sycl-toolchain-cache.outputs.cache-hit }}
build-sycl:
name: ${{ matrix.platform }} ${{ matrix.build_type }}
needs: prepare-sycl-toolchain
runs-on: ${{ matrix.runner }}
timeout-minutes: 180
strategy:
fail-fast: true
matrix:
platform:
- linux-x86_64
- linux-arm64
- macos-arm64
- windows-x86_64
build_type:
- Debug
- Release
include:
- platform: linux-x86_64
runner: ubuntu-latest
- platform: linux-arm64
runner: ubuntu-24.04-arm
- platform: macos-arm64
runner: macos-15
- platform: windows-x86_64
runner: windows-2022
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ github.job }}-${{ matrix.platform }}-${{ matrix.build_type }}
max-size: 4G
- name: Restore AdaptiveCpp toolchain cache
if: runner.os != 'macOS'
uses: actions/cache/restore@v4
with:
path: |
${{ runner.temp }}/AdaptiveCpp
${{ runner.temp }}/AdaptiveCpp-build
${{ runner.temp }}/adaptivecpp-install
${{ runner.temp }}/archives
key: sycl-toolchain-${{ matrix.platform }}-${{ env.ADAPTIVECPP_TAG }}-${{ env.ADAPTIVECPP_CACHE_VERSION }}
fail-on-cache-miss: true
- name: Setup SYCL toolchain
uses: ./.github/actions/setup-sycl-toolchain
with:
phase: build
- name: Configure
if: runner.os != 'Windows'
shell: bash
run: |
cmake -S . -B "build/${{ matrix.build_type }}" -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER="${ITLABAI_CC}" \
-DCMAKE_CXX_COMPILER="${ITLABAI_CXX}" \
-DCMAKE_PREFIX_PATH="${ITLABAI_CMAKE_PREFIX_PATH}" \
-DOpenMP_ROOT="${ITLABAI_OPENMP_ROOT}" \
-DACPP_TARGETS="${ACPP_TARGETS}" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Configure
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake -S . -B "build/${{ matrix.build_type }}" -G Ninja `
"-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}" `
"-DCMAKE_C_COMPILER=$env:ITLABAI_CC" `
"-DCMAKE_CXX_COMPILER=$env:ITLABAI_CXX" `
"-DCMAKE_PREFIX_PATH=$env:ITLABAI_CMAKE_PREFIX_PATH" `
"-DACPP_TARGETS=$env:ACPP_TARGETS" `
"-DACPP_CPU_CXX=$env:ITLABAI_ACPP_CPU_CXX" `
-DCMAKE_C_COMPILER_LAUNCHER=ccache `
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Build
run: cmake --build "build/${{ matrix.build_type }}" --target SYCL_Example run_test --parallel
- name: Test
run: ctest --test-dir "build/${{ matrix.build_type }}" --output-on-failure -R '^(UnitTests|SYCL\.Example)$'
codecov-sycl:
name: codecov sycl
needs: prepare-sycl-toolchain
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ github.job }}-linux-x86_64
max-size: 4G
- name: Restore AdaptiveCpp toolchain cache
uses: actions/cache/restore@v4
with:
path: |
${{ runner.temp }}/AdaptiveCpp
${{ runner.temp }}/AdaptiveCpp-build
${{ runner.temp }}/adaptivecpp-install
${{ runner.temp }}/archives
key: sycl-toolchain-linux-x86_64-${{ env.ADAPTIVECPP_TAG }}-${{ env.ADAPTIVECPP_CACHE_VERSION }}
fail-on-cache-miss: true
- name: Setup SYCL toolchain
uses: ./.github/actions/setup-sycl-toolchain
with:
phase: build
- name: Install coverage tools
shell: bash
run: sudo apt-get update && sudo apt-get install -y gcovr
- name: Configure
shell: bash
run: |
cmake -S . -B build/sycl-coverage -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER="${ITLABAI_CC}" \
-DCMAKE_CXX_COMPILER="${ITLABAI_CXX}" \
-DCMAKE_PREFIX_PATH="${ITLABAI_CMAKE_PREFIX_PATH}" \
-DOpenMP_ROOT="${ITLABAI_OPENMP_ROOT}" \
-DACPP_TARGETS="${ACPP_TARGETS}" \
-DCMAKE_C_FLAGS="--coverage" \
-DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DCMAKE_SHARED_LINKER_FLAGS="--coverage" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build build/sycl-coverage --target SYCL_Example run_test --parallel
- name: Test
run: ctest --test-dir build/sycl-coverage --output-on-failure -R '^(UnitTests|SYCL\.Example)$'
- name: Generate SYCL coverage data
run: |
gcovr -r . --xml -o sycl-coverage.xml \
--gcov-executable "llvm-cov-18 gcov" \
--gcov-ignore-parse-errors \
--exclude-branches-by-pattern ".*" \
--filter "include/.*" \
--filter "src/.*" \
--filter "app/.*" \
--filter "test/.*"
- name: Upload SYCL coverage report to Codecov
uses: codecov/codecov-action@v4.0.1
with:
file: sycl-coverage.xml
disable_search: true
flags: sycl
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
slug: embedded-dev-research/ITLabAI