forked from jrprice/Oclgrind
-
Notifications
You must be signed in to change notification settings - Fork 0
303 lines (294 loc) · 10.4 KB
/
ci.yml
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
name: CI
on: [push, pull_request]
env:
RELEASE_VERSION: "21.10"
RELEASE_LLVM: "14"
jobs:
check-format:
name: Check formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: sudo apt-get install -y clang-format
- name: Check formatting
run: bash .github/workflows/check-format.sh
build:
name: Build ${{ matrix.os }} llvm-${{ matrix.llvm }} ${{ matrix.compiler }} ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
needs: [check-format]
env:
LLVM_VERSION: ${{ matrix.llvm }}
INSTALL_DIR: "${{ github.workspace }}/install"
strategy:
matrix:
os: [ubuntu-20.04, macos-11.0]
compiler: [gcc, clang]
build_type: [Release, Debug]
llvm: [12, 13, 14]
exclude:
- os: macos-11.0
llvm: 13
- os: macos-11.0
compiler: gcc
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: bash .github/workflows/install-deps.sh
- name: Set LLVM_DIR
shell: bash
run: |
if [[ "${{ matrix.os }}" =~ ubuntu-.* ]]; then
echo LLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm >>$GITHUB_ENV
elif [[ "${{ matrix.os }}" =~ macos-.* ]]; then
echo LLVM_DIR=$PWD/llvm-${LLVM_VERSION}/lib/cmake/llvm >>$GITHUB_ENV
fi
- name: Set compiler
shell: bash
run: |
if [ "${{ matrix.compiler }}" == "gcc" ]; then
echo CC=gcc >>$GITHUB_ENV
echo CXX=g++ >>$GITHUB_ENV
elif [ "${{ matrix.compiler }}" == "clang" ]; then
echo CC=clang >>$GITHUB_ENV
echo CXX=clang++ >>$GITHUB_ENV
fi
- name: Create build dir
run: cmake -E make_directory build
- name: CMake
run: >
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
-DLLVM_DIR="$LLVM_DIR"
working-directory: build
- name: Build
run: cmake --build . --config ${{ matrix.build_type }}
working-directory: build
- name: Test
run: ctest -C ${{ matrix.build_type }} --output-on-failure
working-directory: build
- name: Install
run: cmake --install . --config ${{ matrix.build_type }}
working-directory: build
- name: Prepare build artifact
shell: bash
run: |
if [[ "${{ matrix.os }}" =~ ubuntu-.* ]]; then
cp src/install/INSTALL.linux ${INSTALL_DIR}
elif [[ "${{ matrix.os }}" =~ macos-.* ]]; then
cp src/install/INSTALL.darwin ${INSTALL_DIR}
fi
mv ${INSTALL_DIR} oclgrind-${RELEASE_VERSION}
mkdir -p artifact
tar czf artifact/oclgrind-${RELEASE_VERSION}.tgz oclgrind-${RELEASE_VERSION}
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-${{ matrix.os }}-llvm${{ matrix.llvm }}-${{ matrix.build_type }}-${{ matrix.compiler }}
path: artifact
build-windows:
name: Build ${{ matrix.platform }} llvm-${{ matrix.llvm }}
runs-on: windows-2019
needs: [check-format]
env:
LLVM_VERSION: ${{ matrix.llvm }}
BUILD_PLATFORM: ${{ matrix.platform }}
strategy:
matrix:
platform: [Win32, x64]
llvm: [12, 13, 14]
steps:
- uses: actions/checkout@v2
- name: cache-llvm
uses: actions/cache@v2
with:
path: llvm-${{ matrix.llvm }}
key: llvm-${{ matrix.llvm }}-${{ matrix.platform }}
- name: Install dependencies
run: bash .github/workflows/install-deps.sh
- name: Create build dir
run: cmake -E make_directory build
- name: CMake
shell: bash
run: >
cmake .. -G "Visual Studio 16 2019" -A ${{ matrix.platform }}
-DLLVM_DIR=$PWD/../llvm-${{ matrix.llvm }}/install/lib/cmake/llvm
-DCMAKE_INSTALL_PREFIX=$PWD/../install/
working-directory: build
- name: Build
run: cmake --build . --config Release --target ALL_BUILD
working-directory: build
- name: Test
run: >
cmake --build . --config Release --target RUN_TESTS ;
cat ./Testing/Temporary/LastTest.log
working-directory: build
- name: Install
run: cmake --build . --config Release --target INSTALL
working-directory: build
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-Windows-${{ matrix.platform }}-llvm${{ matrix.llvm }}
path: install
retention-days: 5
upload-windows-binaries:
name: Upload Windows binaries
runs-on: ubuntu-20.04
needs: [build-windows]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-Windows-Win32-llvm${{ env.RELEASE_LLVM }}
path: artifact/oclgrind-${{ env.RELEASE_VERSION }}/x86
- uses: actions/download-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-Windows-x64-llvm${{ env.RELEASE_LLVM }}
path: artifact/oclgrind-${{ env.RELEASE_VERSION }}/x64
- name: Prepare directory
shell: bash
run: |
outdir=artifact/oclgrind-${{ env.RELEASE_VERSION }}
cp src/install/INSTALL.windows $outdir/INSTALL.txt
cp src/install/install.bat $outdir/
cp src/install/uninstall.bat $outdir/
cp src/install/oclgrind-icd.reg $outdir/
mkdir $outdir/include
mv $outdir/x64/include/CL $outdir/include/
cp -r $outdir/x64/include/oclgrind $outdir/include/
rm -rf $outdir/include/oclgrind/*.pch
rm -rf $outdir/x86/include/CL
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-Windows
path: artifact
build-cts:
name: Build OpenCL CTS
runs-on: ubuntu-20.04
needs: [build]
env:
cts_hash: 92285f7c9de965ddc41e7dfaaab8c7c75aa55dbe
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: cache-cts
with:
path: opencl-cts
key: opencl-cts-${{ env.cts_hash }}
- name: Install dependencies
if: steps.cache-cts.outputs.cache-hit != 'true'
run: bash .github/workflows/install-deps.sh
- uses: actions/checkout@v2
if: steps.cache-cts.outputs.cache-hit != 'true'
with:
repository: KhronosGroup/OpenCL-CTS
path: opencl-cts
ref: ${{ env.cts_hash }}
- uses: actions/checkout@v2
if: steps.cache-cts.outputs.cache-hit != 'true'
with:
repository: KhronosGroup/OpenCL-Headers
path: opencl-cts/opencl-headers
- uses: actions/checkout@v2
if: steps.cache-cts.outputs.cache-hit != 'true'
with:
repository: KhronosGroup/OpenCL-ICD-Loader
path: opencl-cts/opencl-icd-loader
- name: Create ICD loader build dir
run: cmake -E make_directory opencl-cts/opencl-icd-loader/build
- name: CMake ICD Loader
if: steps.cache-cts.outputs.cache-hit != 'true'
run: >
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PWD/../../install \
-DOPENCL_ICD_LOADER_HEADERS_DIR=$PWD/../../opencl-headers
working-directory: opencl-cts/opencl-icd-loader/build
- name: Build ICD Loader
if: steps.cache-cts.outputs.cache-hit != 'true'
run: >
cmake --build . && cmake --install .
working-directory: opencl-cts/opencl-icd-loader/build
- name: Create CTS build dir
run: cmake -E make_directory opencl-cts/build
- name: CMake CTS
if: steps.cache-cts.outputs.cache-hit != 'true'
run: >
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PWD/../install \
-DCL_INCLUDE_DIR=$PWD/../opencl-headers \
-DCL_LIB_DIR=$PWD/../install/lib \
-DCL_LIBCLCXX_DIR=. \
-DCLConform_LIBRARIES=OpenCL
working-directory: opencl-cts/build
- name: Build CTS
if: steps.cache-cts.outputs.cache-hit != 'true'
run: cmake --build .
working-directory: opencl-cts/build
run-cts:
name: Run OpenCL CTS ${{ matrix.suite[0] }}
runs-on: ubuntu-20.04
needs: [build-cts]
env:
cts_hash: 92285f7c9de965ddc41e7dfaaab8c7c75aa55dbe
strategy:
fail-fast: false
matrix:
suite: [
[allocations],
[api],
[atomics],
[basic],
[buffers],
[commonfns],
[compiler],
[computeinfo],
[contractions],
[conversions, "-w -[4096]"],
[events],
[geometrics],
[images_clCopyImage],
[images_clFillImage],
[images_clGetInfo],
[images_clReadWriteImage],
[images_kernel_image_methods],
[images_kernel_read_write, read write small_images CL_FILTER_NEAREST CL_RGBA], # TODO: Enable all orders.
[images_samplerlessReads],
[half, -w],
#[integer_ops], # TODO: Fix crash.
#[math_brute_force, -w -m], # TODO: Fix crash when multi-threaded and access-when-mapped issue in CTS.
[mem_host_flags],
[multiple_device_context],
[printf],
[profiling],
[relationals],
[select, -w],
#[thread_dimensions], # TODO: Takes too long.
[vectors],
]
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: >
LLVM_VERSION=${{ env.RELEASE_LLVM }} \
bash .github/workflows/install-deps.sh
- name: Download Oclgrind
uses: actions/download-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-ubuntu-20.04-llvm${{ env.RELEASE_LLVM }}-Release-gcc
- name: Unpack Oclgrind
shell: bash
run: |
tar xf oclgrind-${RELEASE_VERSION}.tgz
- name: cache-cts
uses: actions/cache@v2
with:
path: opencl-cts
key: opencl-cts-${{ env.cts_hash }}
- name: Run CTS suite
run: bash .github/workflows/run-cts-suite.sh ${{ matrix.suite[0] }} ${{ matrix.suite[1] }}