@@ -2,6 +2,10 @@ name: Build and test
22
33on : [push, pull_request]
44
5+ concurrency :
6+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
7+ cancel-in-progress : true
8+
59jobs :
610 ubuntu-build :
711 name : Build - Ubuntu
@@ -58,26 +62,42 @@ jobs:
5862 cd ..
5963
6064 - name : Download DPC++
65+ if : matrix.os == 'ubuntu-22.04'
6166 run : |
6267 sudo apt install libncurses5
63- wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
64- tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
68+ wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-09-21/sycl_linux.tar.gz
69+ mkdir -p ${{github.workspace}}/dpcpp_compiler
70+ tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler
6571
6672 - name : Configure CMake
73+ if : matrix.os == 'ubuntu-22.04'
6774 run : >
6875 cmake
6976 -B${{github.workspace}}/build
7077 -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
7178 -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
7279 -DUR_ENABLE_TRACING=ON
73- -DUR_DEVELOPER_MODE=ON
7480 -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
7581 -DUR_BUILD_TESTS=ON
7682 -DUR_FORMAT_CPP_STYLE=ON
7783 -DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
7884 ${{matrix.libbacktrace}}
7985 ${{matrix.pool_tracking}}
8086
87+ - name : Configure CMake
88+ if : matrix.os == 'ubuntu-20.04'
89+ run : >
90+ cmake
91+ -B${{github.workspace}}/build
92+ -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
93+ -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
94+ -DUR_ENABLE_TRACING=ON
95+ -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
96+ -DUR_BUILD_TESTS=ON
97+ -DUR_FORMAT_CPP_STYLE=ON
98+ ${{matrix.libbacktrace}}
99+ ${{matrix.pool_tracking}}
100+
81101 - name : Generate source from spec, check for uncommitted diff
82102 if : matrix.os == 'ubuntu-22.04'
83103 run : cmake --build ${{github.workspace}}/build --target check-generated
@@ -92,11 +112,192 @@ jobs:
92112 working-directory : ${{github.workspace}}/build
93113 run : ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace"
94114
115+ fuzztest-build :
116+ name : Build and run quick fuzztest scenarios
117+ strategy :
118+ matrix :
119+ build_type : [Debug, Release]
120+ compiler : [{c: clang, cxx: clang++}]
121+
122+ runs-on : ' ubuntu-22.04'
123+
124+ steps :
125+ - uses : actions/checkout@v3
126+
127+ - name : Install pip packages
128+ run : pip install -r third_party/requirements.txt
129+
130+ - name : Download DPC++
131+ run : |
132+ sudo apt install libncurses5
133+ wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
134+ tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
135+
136+ - name : Setup DPC++
137+ run : |
138+ source ${{github.workspace}}/dpcpp_compiler/startup.sh
139+
140+ - name : Configure CMake
141+ run : >
142+ cmake
143+ -B${{github.workspace}}/build
144+ -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
145+ -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
146+ -DUR_ENABLE_TRACING=ON
147+ -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
148+ -DUR_BUILD_TESTS=ON
149+ -DUR_USE_ASAN=ON
150+ -DUR_USE_UBSAN=ON
151+ -DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
152+
153+ - name : Build
154+ run : cmake --build ${{github.workspace}}/build -j $(nproc)
155+
156+ - name : Fuzz test
157+ working-directory : ${{github.workspace}}/build
158+ run : ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-short"
159+
160+ adapter-build-hw :
161+ name : Build - Adapters on HW
162+ if : github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
163+ strategy :
164+ matrix :
165+ adapter : [
166+ {name: CUDA, triplet: nvptx64-nvidia-cuda, platform: ""},
167+ {name: HIP, triplet: amdgcn-amd-amdhsa, platform: ""},
168+ {name: L0, triplet: spir64, platform: ""},
169+ {name: OPENCL, triplet: spir64, platform: "Intel(R) OpenCL"}
170+ ]
171+ build_type : [Debug, Release]
172+ compiler : [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
173+
174+ runs-on : ${{matrix.adapter.name}}
175+
176+ steps :
177+ - uses : actions/checkout@v3
178+
179+ - name : Install pip packages
180+ run : pip install -r third_party/requirements.txt
181+
182+ - name : Download DPC++
183+ run : |
184+ wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-09-21/sycl_linux.tar.gz
185+ mkdir dpcpp_compiler
186+ tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
187+
188+ - name : Configure CMake
189+ run : >
190+ cmake
191+ -B${{github.workspace}}/build
192+ -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
193+ -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
194+ -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
195+ -DUR_ENABLE_TRACING=ON
196+ -DUR_DEVELOPER_MODE=ON
197+ -DUR_BUILD_TESTS=ON
198+ -DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
199+ -DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
200+ -DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
201+ -DUR_CONFORMANCE_TARGET_TRIPLES=${{matrix.adapter.triplet}}
202+ ${{ matrix.adapter.name == 'HIP' && '-DAMD_ARCH=gfx1030' || '' }}
203+ ${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
204+
205+ - name : Build
206+ # This is so that device binaries can find the sycl runtime library
207+ run : cmake --build ${{github.workspace}}/build -j $(nproc)
208+
209+ - name : Test adapter specific
210+ working-directory : ${{github.workspace}}/build
211+ run : ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
212+
213+ # Temporarily disabling platform test for L0, because of hang
214+ # See issue: #824
215+ - name : Test L0 adapter
216+ if : matrix.adapter.name == 'L0'
217+ working-directory : ${{github.workspace}}/build
218+ run : ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" -E "platform-adapter_level_zero" --timeout 180
219+
220+ - name : Test adapters
221+ if : matrix.adapter.name != 'L0'
222+ working-directory : ${{github.workspace}}/build
223+ run : env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
224+
225+ - name : Get information about platform
226+ if : ${{ always() }}
227+ run : .github/scripts/get_system_info.sh
228+
229+ examples-build-hw :
230+ name : Build - examples on HW
231+ if : github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
232+ strategy :
233+ matrix :
234+ adapter : [
235+ {name: L0}
236+ ]
237+ build_type : [Debug, Release]
238+ compiler : [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
239+
240+ runs-on : ${{matrix.adapter.name}}
241+
242+ steps :
243+ - uses : actions/checkout@v3
244+
245+ - name : Install pip packages
246+ run : pip install -r third_party/requirements.txt
247+
248+ - name : Init conda env
249+ uses : conda-incubator/setup-miniconda@v2
250+ with :
251+ miniconda-version : " latest"
252+ activate-environment : examples
253+ environment-file : third_party/deps.yml
254+ auto-activate-base : false
255+
256+ - name : Configure CMake
257+ shell : bash -el {0}
258+ run : >
259+ cmake
260+ -B${{github.workspace}}/build
261+ -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
262+ -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
263+ -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
264+ -DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
265+ -DUR_BUILD_EXAMPLE_CODEGEN=ON
266+ -DUR_DEVELOPER_MODE=ON
267+
268+ - name : Build
269+ run : cmake --build ${{github.workspace}}/build -j $(nproc)
270+
271+ - name : Test codegen example
272+ working-directory : ${{github.workspace}}/build
273+ run : bin/codegen
274+
275+ # conda init adds content to user's profile making it failing (if conda is gone)
276+ - name : Cleanup after conda init
277+ run : |
278+ cat ${HOME}/.profile || true
279+ rm ${HOME}/.profile || true
280+
281+ - name : Get information about platform
282+ if : ${{ always() }}
283+ run : .github/scripts/get_system_info.sh
284+
95285 windows-build :
96286 name : Build - Windows
97287 strategy :
98288 matrix :
99289 os : ['windows-2019', 'windows-2022']
290+ adapter : [
291+ {name: None, var: ''}, {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
292+ ]
293+
294+ # TODO: building level zero loader on windows-2019 and clang-cl is currently broken
295+ exclude :
296+ - os : ' windows-2019'
297+ adapter : {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
298+ - adapter : {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
299+ compiler : {c: clang-cl, cxx: clang-cl}
300+
100301 build_type : [Debug, Release]
101302 compiler : [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
102303 include :
@@ -133,10 +334,12 @@ jobs:
133334 -DUR_DEVELOPER_MODE=ON
134335 -DUR_BUILD_TESTS=ON
135336 -DUR_FORMAT_CPP_STYLE=ON
337+ ${{matrix.adapter.var}}
136338
137- - name : Generate source from spec, check for uncommitted diff
138- if : matrix.os == 'windows-2022'
139- run : cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}}
339+ # TODO: re-enable when check-generated is fixed for windows runners see #888
340+ # - name: Generate source from spec, check for uncommitted diff
341+ # if: matrix.os == 'windows-2022'
342+ # run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}}
140343
141344 - name : Build all
142345 run : cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
0 commit comments