-
Notifications
You must be signed in to change notification settings - Fork 34
249 lines (221 loc) · 8.96 KB
/
planned_testing.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
# Simple workflow for running non-documentation PR testing
name: Run ock tests for PR testing
on:
workflow_call:
inputs:
ock:
required: false
type: boolean
default: true
test_tornado:
required: false
type: boolean
default: true
target_list:
required: false
type: string
llvm_version:
required: false
type: string
default: 18
- target: host_aarch64_linux
- target: host_x86_64_linux
- target: host_arm_linux
- target: host_refsi_linux
- target: host_i686_linux
- target: host_x86_64_windows
jobs:
create_workflow_vars:
runs-on: ubuntu-22.04
outputs:
exclude_except_linux_x86_64_aarch64: ${{ steps.vars.outputs.exclude_except_linux_x86_64_aarch64 }}
steps:
- id: vars
run: |
echo exclude_except_linux_x86_64_aarch64="[ {\"target\": \"host_arm_linux\"}, {\"target\": \"host_refsi_linux\"}, {\"target\": \"host_i686_linux\"}, {\"target\": \"host_x86_64_windows\"}]" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
run: |
echo
# create_ock_artefacts:
# needs: [create_workflow_vars]
# strategy:
# matrix:
# target: ${{ fromJson(inputs.target_list) }}
# exclude: ${{ fromJson(needs.create_workflow_vars.outputs.exclude_except_linux_x86_64_aarch64) }}
# runs-on: ${{ (contains(matrix.target, 'host_riscv') && 'ubuntu-24.04') || (contains(matrix.target, 'windows') && 'windows-2019' || 'ubuntu-22.04' ) }}
# if : inputs.ock
# steps:
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: build ock artefact
# uses: ./.github/actions/do_build_ock_artefact
# with:
# target: ${{ matrix.target }}
# llvm_version: ${{ inputs.llvm_version }}
build_icd:
needs: [create_workflow_vars]
strategy:
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.create_workflow_vars.outputs.exclude_except_linux_x86_64_aarch64) }}
runs-on: ubuntu-22.04
steps:
- name: clone ock platform
uses: actions/checkout@v4
with:
sparse-checkout: |
platform
.github
# The following can also be done with the matrix with exclude: to limit the targets to what we want
- name : build and upload icd ${{matrix.target}}
uses: ./.github/actions/do_build_icd
with:
target: ${{matrix.target}}
# - name : build and upload icd aarch64
# if: (contains(inputs.target_list, 'host_aarch64_linux'))
# uses: ./.github/actions/do_build_icd
# with:
# target: host_aarch64_linux
# Todo: convert to matrix and/or more jobs when support more than host_x86_64_linux
# build_run_tornado:
# if: contains(inputs.target_list, 'host_x86_64_linux')
# needs: [ build_icd, create_ock_artefacts ]
# runs-on: ubuntu-22.04
# steps:
# - name: clone ock platform
# uses: actions/checkout@v4
# with:
# sparse-checkout: |
# platform
# .github
# - name : build and upload tornado
# if: (contains(inputs.target_list, 'host_x86_64_linux'))
# uses: ./.github/actions/do_build_tornado
# with:
# target: host_x86_64_linux
# # TODO: Consider separating out tornado build and run in the future
# # but for now it saves us reinstalling everything.
# - name : run tornado example
# uses: ./.github/actions/run_tornado
# with:
# target: host_x86_64_linux
# - name: Install Ninja
# uses: llvm/actions/install-ninja@main
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
# build_type: [RelAssert]
# exclude:
# - os: windows-2019
# - target: riscv64
# runs-on: ${{ matrix.os }}
# steps:
# # - name: Install Ninja
# # uses: llvm/actions/install-ninja@main
# - name: clone ock platform
# uses: actions/checkout@v4
# with:
# sparse-checkout: |
# platform
# .github
# - name: download icd artifact
# uses: actions/download-artifact@v4
# with:
# name: icd_${{matrix.os}}_${{matrix.target}}
# path: install_icd
# # Get maven
# - name: fetch maven
# run: |
# wget https://archive.apache.org/dist/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.tar.gz
# tar xf apache-maven-3.9.3-bin.tar.gz
# # for x86, we'll need to do something else for aarch64
# - name: select jdk21
# run: |
# sudo update-java-alternatives -s temurin-21-jdk-amd64
# pip install tqdm
# - name: build tornadovm
# run: |
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1 TornadoVM_build
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'`
# export TORNADO_SDK=$GITHUB_WORKSPACE/TornadoVM_build/bin/sdk
# export PATH=$PWD/apache-maven-3.9.3/bin:$PATH
# mvn -v
# java --version
# cd TornadoVM_build
# # The tornado build system links in OpenCL assuming it's in a known place. This gets around
# # this by pass CXX as an environment variable as it's difficult to change the build system
# # even if we don't use this script.
# CXX="g++ -L$GITHUB_WORKSPACE/install_icd/lib" make -j8 jdk21 BACKEND=opencl
# # # Not sure if gitlab ci does not follow symbolic links so copy for the artefact
# # cp -r -L $TORNADO_SDK $GITHUB_WORKSPACE/TornadoVM_SDK
# - name: Download ock artefact
# uses: actions/download-artifact@v4
# with:
# name: ock_${{matrix.os}}_${{matrix.target}}
# path: install_ock
# - name: Run tornado example
# run: |
# export ARTEFACT_CHECKOUT_PATH=$GITHUB_WORKSPACE/install_ock
# echo ARTEFACT_CHECKOUT_PATH is $ARTEFACT_CHECKOUT_PATH
# ls $ARTEFACT_CHECKOUT_PATH
# export ICD_LOADER_INSTALL_PATH=$GITHUB_WORKSPACE/install_icd
# echo ICD_LOADER_INSTALL_PATH is $ICD_LOADER_INSTALL_PATH
# ls $ICD_LOADER_INSTALL_PATH
# export LD_LIBRARY_PATH=$ICD_LOADER_INSTALL_PATH/lib:$LD_LIBRARY_PATH
# echo $LD_LIBRARY_PATH
# export OCL_ICD_FILENAMES=$ARTEFACT_CHECKOUT_PATH/lib/libCL.so
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'`
# export TORNADO_SDK=$GITHUB_WORKSPACE/TornadoVM_build/bin/sdk
# export PATH=$TORNADO_SDK/bin:$PATH
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1
# cd TornadoVM
# CA_HOST_DUMP_ASM=1 tornado --printKernel --threadInfo -m tornado.examples/uk.ac.manchester.tornado.examples.compute.MatrixMultiplication2D 256
# todo : download ock artefact
# Run tornado example
# at some point we will make an artefact if we want to do more, but it is enough to show it working using the created files.
# - name: run tornado example
# run: |
# echo ARTEFACT_CHECKOUT_PATH is $ARTEFACT_CHECKOUT_PATH
# ls $ARTEFACT_CHECKOUT_PATH
# export LD_LIBRARY_PATH=$ICD_LOADER_INSTALL_PATH/lib:$LD_LIBRARY_PATH
# echo $LD_LIBRARY_PATH
# export OCL_ICD_FILENAMES=$ARTEFACT_CHECKOUT_PATH/lib/libCL.so
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'`
# export TORNADO_SDK=$CI_PROJECT_DIR/TornadoVM_SDK
# export PATH=$TORNADO_SDK/bin:$PATH
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1
# cd TornadoVM
# toolchain:
# description: 'path to toolchain'
# default: $GITHUB_WORKSPACE/ock/platform/x86_64-linux.cmake
# build_type:
# description: 'path to toolchain'
# default: ock/platform/x86_64-linux.cmake
# name:
# description: 'artifact name'
# default: ubuntu-22.04-x86_64
# use_ock_artefacts:
# needs: [ calc_matrix, create_ock_artefacts ]
# strategy:
# matrix:
# target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
# build_type: [RelAssert]
# exclude:
# - os: windows-2019
# - target: riscv64
# runs-on: ${{ matrix.os }}
# steps:
# - name: Download ock artefact
# uses: actions/download-artifact@v4
# with:
# name: ock_${{matrix.os}}_${{matrix.target}}
# path: ock_${{matrix.os}}_${{matrix.target}}
# - name: print ock artefact
# run: |
# ls -R .
# echo "${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.arch }}" > foo.txt
# --define CA_CL_ENABLE_ICD_LOADER=ON
# --define OCL_EXTENSION_cl_khr_command_buffer=ON
# --define OCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch=ON
# --define OCL_EXTENSION_cl_khr_extended_async_copies=ON
# --target check-ock
# -B build