40
40
build_configure_extra_args :
41
41
type : string
42
42
required : false
43
- default : " "
43
+ default : " --hip --hip-amd-arch=gfx906 --cuda "
44
44
build_artifact_suffix :
45
45
type : string
46
46
required : true
47
+ intel_drivers_image :
48
+ type : string
49
+ required : false
50
+ default : " ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest"
51
+ lts_config :
52
+ type : string
53
+ required : false
54
+ default : " "
55
+ gen9_runs_on :
56
+ type : string
57
+ required : false
58
+ default : " gen9"
59
+ amdgpu_image :
60
+ type : string
61
+ required : false
62
+ default : " ghcr.io/intel/llvm/ubuntu2004_build:latest"
63
+ amdgpu_runs_on :
64
+ type : string
65
+ required : false
66
+ default : " amdgpu"
47
67
48
68
jobs :
49
69
configure :
@@ -60,15 +80,20 @@ jobs:
60
80
INPUTS="{
61
81
\"cc\":\"gcc\",
62
82
\"cxx\":\"g++\",
63
- \"build_runs_on\":\"sycl-precommit-linux \",
83
+ \"build_runs_on\":\"build \",
64
84
\"build_image\":\"ghcr.io/intel/llvm/ubuntu2004_build:latest\",
65
85
\"build_github_cache\":\"false\",
66
86
\"build_cache_root\":\"/__w/\",
67
87
\"build_cache_suffix\":\"default\",
68
88
\"build_cache_size\":\"2G\",
69
- \"build_configure_extra_args\":\"\",
89
+ \"build_configure_extra_args\":\"--hip --hip-amd-arch=gfx906 --cuda \",
70
90
\"build_artifact_suffix\":\"default\",
71
- \"build_upload_artifact\":\"false\"
91
+ \"build_upload_artifact\":\"false\",
92
+ \"intel_drivers_image\":\"ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest\",
93
+ \"amdgpu_image\":\"ghcr.io/intel/llvm/ubuntu2004_build:latest\",
94
+ \"lts_config\":\"ocl_x64;hip_amdgpu\",
95
+ \"gen9_runs_on\":\"gen9\",
96
+ \"amdgpu_runs_on\":\"amdgpu\"
72
97
}"
73
98
fi
74
99
INPUTS="${INPUTS//'%'/'%25'}"
77
102
echo "::set-output name=params::$INPUTS"
78
103
echo "$INPUTS"
79
104
build :
80
- name : Build SYCL toolchain
105
+ name : Build + LIT
81
106
needs : configure
82
107
runs-on : ${{ fromJSON(needs.configure.outputs.params).build_runs_on }}
83
108
container :
87
112
- uses : actions/checkout@v2
88
113
with :
89
114
path : src
115
+ - name : Register cleanup after job is finished
116
+ uses : ./src/devops/actions/cleanup
90
117
- name : Setup Cache
91
118
uses : actions/cache@v2
92
119
if : ${{ steps.parameters.build_github_cache }}
@@ -111,10 +138,11 @@ jobs:
111
138
cd $GITHUB_WORKSPACE/build
112
139
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
113
140
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
114
- --ci-defaults $ARGS --cuda --hip --hip-amd-arch="gfx906" \
141
+ --ci-defaults $ARGS \
115
142
--cmake-opt="-DLLVM_CCACHE_BUILD=ON" \
116
143
--cmake-opt="-DLLVM_CCACHE_DIR=$CACHE_ROOT/build_cache_$CACHE_SUFFIX" \
117
144
--cmake-opt="-DLLVM_CCACHE_MAXSIZE=$CACHE_SIZE" \
145
+ --cmake-opt="-DLLVM_INSTALL_UTILS=ON" \
118
146
--cmake-opt="-DSYCL_PI_TESTS=OFF"
119
147
- name : Compile
120
148
run : cmake --build $GITHUB_WORKSPACE/build
@@ -157,15 +185,128 @@ jobs:
157
185
cmake --build $GITHUB_WORKSPACE/build --target utils/llvm-lit/install
158
186
cmake --build $GITHUB_WORKSPACE/build --target install-clang-format
159
187
cmake --build $GITHUB_WORKSPACE/build --target install-clang-tidy
188
+ cmake --build $GITHUB_WORKSPACE/build --target install-llvm-size
189
+ # TODO this should be resolved in CMakeLists.txt
190
+ cmake --build $GITHUB_WORKSPACE/build --target install-lld || echo "skipped"
160
191
161
- - name : Pack
192
+ - name : Pack toolchain
162
193
run : tar -cJf llvm_sycl.tar.xz -C $GITHUB_WORKSPACE/build/install .
163
- - name : Upload artifacts
194
+ - name : Pack LIT
195
+ run : tar -cJf lit.tar.xz -C $GITHUB_WORKSPACE/src/llvm/utils/lit .
196
+ - name : Upload toolchain
164
197
uses : actions/upload-artifact@v1
165
198
with :
166
199
name : sycl_linux_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
167
200
path : llvm_sycl.tar.xz
168
- - name : Cleanup
169
- if : always()
170
- run : rm -rf $GITHUB_WORKSPACE/*
201
+ - name : Upload LIT
202
+ uses : actions/upload-artifact@v1
203
+ with :
204
+ name : sycl_lit_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
205
+ path : lit.tar.xz
171
206
207
+ llvm_test_suite_l0_gen9 :
208
+ name : L0 GEN9 Test Suite
209
+ needs : [build, configure]
210
+ if : ${{ contains(fromJSON(needs.configure.outputs.params).lts_config, 'l0_gen9') }}
211
+ runs-on : ${{ fromJSON(needs.configure.outputs.params).gen9_runs_on }}
212
+ container :
213
+ image : ${{ fromJSON(needs.configure.outputs.params).intel_drivers_image }}
214
+ options : -u 1001 --device=/dev/dri
215
+ steps :
216
+ - uses : actions/checkout@v2
217
+ with :
218
+ path : llvm
219
+ - name : Register cleanup after job is finished
220
+ uses : ./llvm/devops/actions/cleanup
221
+ - uses : ./llvm/devops/actions/llvm_test_suite
222
+ name : Run LLVM Test Suite
223
+ with :
224
+ # TODO allow custom test references
225
+ test_ref : ' intel'
226
+ sycl_artifact : sycl_linux_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
227
+ sycl_archive : llvm_sycl.tar.xz
228
+ lit_artifact : sycl_lit_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
229
+ lit_archive : lit.tar.xz
230
+ check_sycl_all : ' level_zero:gpu,host'
231
+ results_name_suffix : l0_gpu_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
232
+ cmake_args : ' -DGPU_AOT_TARGET_OPTS="\\\"-device gen9\\\""'
233
+
234
+ llvm_test_suite_ocl_gen9 :
235
+ name : OCL GEN9 Test Suite
236
+ needs : [build, configure]
237
+ if : ${{ contains(fromJSON(needs.configure.outputs.params).lts_config, 'ocl_gen9') }}
238
+ runs-on : ${{ fromJSON(needs.configure.outputs.params).gen9_runs_on }}
239
+ container :
240
+ image : ${{ fromJSON(needs.configure.outputs.params).intel_drivers_image }}
241
+ options : -u 1001 --device=/dev/dri
242
+ steps :
243
+ - uses : actions/checkout@v2
244
+ with :
245
+ path : llvm
246
+ - name : Register cleanup after job is finished
247
+ uses : ./llvm/devops/actions/cleanup
248
+ - uses : ./llvm/devops/actions/llvm_test_suite
249
+ name : Run LLVM Test Suite
250
+ with :
251
+ # TODO allow custom test references
252
+ test_ref : ' intel'
253
+ sycl_artifact : sycl_linux_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
254
+ sycl_archive : llvm_sycl.tar.xz
255
+ lit_artifact : sycl_lit_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
256
+ lit_archive : lit.tar.xz
257
+ check_sycl_all : ' opencl:gpu,host'
258
+ results_name_suffix : ocl_gpu_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
259
+ cmake_args : ' -DGPU_AOT_TARGET_OPTS="\\\"-device gen9\\\""'
260
+
261
+ llvm_test_suite_ocl_x64 :
262
+ name : OCL x64 Test Suite
263
+ needs : [build, configure]
264
+ if : ${{ contains(fromJSON(needs.configure.outputs.params).lts_config, 'ocl_x64') }}
265
+ runs-on : ${{ fromJSON(needs.configure.outputs.params).gen9_runs_on }}
266
+ container :
267
+ image : ${{ fromJSON(needs.configure.outputs.params).intel_drivers_image }}
268
+ options : -u 1001
269
+ steps :
270
+ - uses : actions/checkout@v2
271
+ with :
272
+ path : llvm
273
+ - name : Register cleanup after job is finished
274
+ uses : ./llvm/devops/actions/cleanup
275
+ - uses : ./llvm/devops/actions/llvm_test_suite
276
+ name : Run LLVM Test Suite
277
+ with :
278
+ # TODO allow custom test references
279
+ test_ref : ' intel'
280
+ sycl_artifact : sycl_linux_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
281
+ sycl_archive : llvm_sycl.tar.xz
282
+ lit_artifact : sycl_lit_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
283
+ lit_archive : lit.tar.xz
284
+ check_sycl_all : ' opencl:cpu,host'
285
+ results_name_suffix : ocl_x64_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
286
+
287
+ llvm_test_suite_hip_amdgpu :
288
+ name : HIP AMD GPU Test Suite
289
+ needs : [build, configure]
290
+ if : ${{ contains(fromJSON(needs.configure.outputs.params).lts_config, 'hip_amdgpu') }}
291
+ runs-on : ${{ fromJSON(needs.configure.outputs.params).amdgpu_runs_on }}
292
+ container :
293
+ image : ${{ fromJSON(needs.configure.outputs.params).amdgpu_image }}
294
+ options : --device=/dev/dri --device=/dev/kfd
295
+ steps :
296
+ - uses : actions/checkout@v2
297
+ with :
298
+ path : llvm
299
+ - name : Register cleanup after job is finished
300
+ uses : ./llvm/devops/actions/cleanup
301
+ - uses : ./llvm/devops/actions/llvm_test_suite
302
+ name : Run LLVM Test Suite
303
+ with :
304
+ # TODO allow custom test references
305
+ test_ref : ' intel'
306
+ sycl_artifact : sycl_linux_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
307
+ sycl_archive : llvm_sycl.tar.xz
308
+ lit_artifact : sycl_lit_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
309
+ lit_archive : lit.tar.xz
310
+ check_sycl_all : ' hip:gpu,host'
311
+ results_name_suffix : hip_amdgpu_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }}
312
+ cmake_args : ' -DHIP_PLATFORM="AMD" -DAMD_ARCH="gfx1031"'
0 commit comments