1
- # This workflow builds and tests providers using GPU memory. It requires
2
- # appropriately labelled self-hosted runners installed on systems with the
3
- # correct GPU and drivers
4
-
1
+ # This workflow builds and tests providers using GPU memory. It requires properly
2
+ # labelled self-hosted runners on systems with the correct GPU and drivers.
5
3
name : GPU
6
4
7
- on : [workflow_call]
5
+ on :
6
+ workflow_call :
7
+ inputs :
8
+ name :
9
+ description : Provider name
10
+ type : string
11
+ required : true
12
+ os :
13
+ description : A list of OSes
14
+ type : string
15
+ default : " ['Ubuntu', 'Windows']"
16
+ build_type :
17
+ description : A list of build types
18
+ type : string
19
+ default : " ['Debug', 'Release']"
20
+ shared_lib :
21
+ description : A list of options for building shared library
22
+ type : string
23
+ default : " ['ON', 'OFF']"
8
24
9
25
permissions :
10
26
contents : read
15
31
COVERAGE_DIR : " ${{github.workspace}}/coverage"
16
32
17
33
jobs :
18
- gpu-Level-Zero :
19
- name : Level-Zero
34
+ gpu :
35
+ name : " ${{matrix.os}}, ${{matrix.build_type}}, shared=${{matrix.shared_library}} "
20
36
env :
21
- VCPKG_PATH : " ${{github.workspace}}/../../../../vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/../../../../vcpkg/packages/tbb_x64-windows;${{github.workspace}}/../../../../vcpkg/packages/jemalloc_x64-windows"
22
- COVERAGE_NAME : " exports-coverage-gpu-L0"
37
+ VCPKG_PATH : " ${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows;"
38
+ CUDA_PATH : " C:/cuda"
39
+ COVERAGE_NAME : " exports-coverage-${{inputs.name}}"
23
40
# run only on upstream; forks will not have the HW
24
41
if : github.repository == 'oneapi-src/unified-memory-framework'
25
42
strategy :
43
+ fail-fast : false
26
44
matrix :
27
- shared_library : ['ON', 'OFF']
28
- os : ['Ubuntu', 'Windows']
29
- build_type : ['Debug', 'Release']
45
+ shared_library : ${{ fromJSON(inputs.shared_lib)}}
46
+ os : ${{ fromJSON(inputs.os)}}
47
+ build_type : ${{ fromJSON(inputs.build_type)}}
30
48
include :
31
49
- os : ' Ubuntu'
32
50
compiler : {c: gcc, cxx: g++}
33
51
number_of_processors : ' $(nproc)'
34
52
- os : ' Windows'
35
53
compiler : {c: cl, cxx: cl}
36
54
number_of_processors : ' $Env:NUMBER_OF_PROCESSORS'
37
- exclude :
38
- - os : ' Windows'
39
- build_type : ' Debug'
40
55
41
- runs-on : ["DSS-LEVEL_ZERO ", "DSS-${{matrix.os}}"]
56
+ runs-on : ["DSS-${{inputs.name}} ", "DSS-${{matrix.os}}"]
42
57
steps :
43
58
- name : Checkout
44
59
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -49,33 +64,23 @@ jobs:
49
64
if : matrix.os == 'Ubuntu'
50
65
run : .github/scripts/get_system_info.sh
51
66
52
- - name : Configure build for Win
67
+ - name : " [Win] Initialize vcpkg "
53
68
if : matrix.os == 'Windows'
69
+ uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
70
+ with :
71
+ vcpkgGitCommitId : 3dd44b931481d7a8e9ba412621fa810232b66289
72
+ vcpkgDirectory : ${{env.BUILD_DIR}}/vcpkg
73
+ vcpkgJsonGlob : ' **/vcpkg.json'
74
+
75
+ - name : " [Win] Install dependencies"
76
+ if : matrix.os == 'Windows'
77
+ run : vcpkg install
78
+
79
+ # note: disable all providers except the one being tested
80
+ - name : Configure build
54
81
run : >
55
82
cmake
56
- -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
57
- -B ${{env.BUILD_DIR}}
58
- -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
59
- -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
60
- -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
61
- -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
62
- -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
63
- -DUMF_BUILD_BENCHMARKS=ON
64
- -DUMF_BUILD_TESTS=ON
65
- -DUMF_BUILD_GPU_TESTS=ON
66
- -DUMF_BUILD_GPU_EXAMPLES=ON
67
- -DUMF_FORMAT_CODE_STYLE=OFF
68
- -DUMF_DEVELOPER_MODE=ON
69
- -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
70
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
71
- -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
72
- -DUMF_BUILD_CUDA_PROVIDER=OFF
73
- -DUMF_TESTS_FAIL_ON_SKIP=ON
74
-
75
- - name : Configure build for Ubuntu
76
- if : matrix.os == 'Ubuntu'
77
- run : >
78
- cmake
83
+ -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}${{env.CUDA_PATH}}"
79
84
-B ${{env.BUILD_DIR}}
80
85
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
81
86
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
@@ -86,14 +91,14 @@ jobs:
86
91
-DUMF_BUILD_TESTS=ON
87
92
-DUMF_BUILD_GPU_TESTS=ON
88
93
-DUMF_BUILD_GPU_EXAMPLES=ON
89
- -DUMF_FORMAT_CODE_STYLE=OFF
90
94
-DUMF_DEVELOPER_MODE=ON
91
95
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
92
96
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
93
- -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
94
97
-DUMF_BUILD_CUDA_PROVIDER=OFF
98
+ -DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
99
+ -DUMF_BUILD_${{inputs.name}}_PROVIDER=ON
95
100
-DUMF_TESTS_FAIL_ON_SKIP=ON
96
- ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
101
+ ${{ matrix.os == 'Ubuntu' && matrix. build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
97
102
98
103
- name : Build UMF
99
104
run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}
@@ -111,7 +116,7 @@ jobs:
111
116
run : ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
112
117
113
118
- name : Check coverage
114
- if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
119
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
115
120
working-directory : ${{env.BUILD_DIR}}
116
121
run : |
117
122
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
@@ -121,133 +126,7 @@ jobs:
121
126
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
122
127
123
128
- uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
124
- if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
129
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
125
130
with :
126
- name : ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
131
+ name : ${{env.COVERAGE_NAME}}-${{matrix.os}}-${{matrix.build_type}}- shared-${{matrix.shared_library}}
127
132
path : ${{env.COVERAGE_DIR}}
128
-
129
- gpu-CUDA :
130
- name : CUDA
131
- env :
132
- COVERAGE_NAME : " exports-coverage-gpu-CUDA"
133
- VCPKG_PATH : " ${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows;"
134
- CUDA_PATH : " c:/cuda"
135
-
136
- # run only on upstream; forks will not have the HW
137
- if : github.repository == 'oneapi-src/unified-memory-framework'
138
- strategy :
139
- matrix :
140
- shared_library : ['ON', 'OFF']
141
- build_type : ['Debug', 'Release']
142
- os : ['Ubuntu', 'Windows']
143
- include :
144
- - os : ' Windows'
145
- compiler : {c: cl, cxx: cl}
146
- number_of_processors : ' $Env:NUMBER_OF_PROCESSORS'
147
- - os : ' Ubuntu'
148
- compiler : {c: gcc, cxx: g++}
149
- number_of_processors : ' $(nproc)'
150
- exclude :
151
- - os : ' Windows'
152
- build_type : ' Debug'
153
-
154
- runs-on : ["DSS-CUDA", "DSS-${{matrix.os}}"]
155
- steps :
156
- - name : Checkout
157
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
158
- with :
159
- fetch-depth : 0
160
-
161
- - name : Get information about platform
162
- if : matrix.os == 'Ubuntu'
163
- run : .github/scripts/get_system_info.sh
164
-
165
- - name : Initialize vcpkg
166
- if : matrix.os == 'Windows'
167
- uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
168
- with :
169
- vcpkgGitCommitId : 3dd44b931481d7a8e9ba412621fa810232b66289
170
- vcpkgDirectory : ${{env.BUILD_DIR}}/vcpkg
171
- vcpkgJsonGlob : ' **/vcpkg.json'
172
-
173
- - name : Install dependencies (windows-latest)
174
- if : matrix.os == 'Windows'
175
- run : vcpkg install
176
- shell : pwsh # Specifies PowerShell as the shell for running the script.
177
-
178
- - name : Configure build for Win
179
- if : matrix.os == 'Windows'
180
- run : >
181
- cmake
182
- -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}${{env.CUDA_PATH}}"
183
- -B ${{env.BUILD_DIR}}
184
- -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
185
- -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
186
- -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
187
- -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
188
- -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
189
- -DUMF_BUILD_BENCHMARKS=ON
190
- -DUMF_BUILD_TESTS=ON
191
- -DUMF_BUILD_GPU_TESTS=ON
192
- -DUMF_BUILD_GPU_EXAMPLES=ON
193
- -DUMF_FORMAT_CODE_STYLE=OFF
194
- -DUMF_DEVELOPER_MODE=ON
195
- -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
196
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
197
- -DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
198
- -DUMF_BUILD_CUDA_PROVIDER=ON
199
- -DUMF_TESTS_FAIL_ON_SKIP=ON
200
-
201
- - name : Configure build for Ubuntu
202
- if : matrix.os == 'Ubuntu'
203
- run : >
204
- cmake
205
- -B ${{env.BUILD_DIR}}
206
- -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
207
- -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
208
- -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
209
- -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
210
- -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
211
- -DUMF_BUILD_BENCHMARKS=ON
212
- -DUMF_BUILD_TESTS=ON
213
- -DUMF_BUILD_GPU_TESTS=ON
214
- -DUMF_BUILD_GPU_EXAMPLES=ON
215
- -DUMF_FORMAT_CODE_STYLE=OFF
216
- -DUMF_DEVELOPER_MODE=ON
217
- -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
218
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
219
- -DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
220
- -DUMF_BUILD_CUDA_PROVIDER=ON
221
- -DUMF_TESTS_FAIL_ON_SKIP=ON
222
- ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
223
-
224
- - name : Build UMF
225
- run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}
226
-
227
- - name : Run tests
228
- working-directory : ${{env.BUILD_DIR}}
229
- run : ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
230
-
231
- - name : Run examples
232
- working-directory : ${{env.BUILD_DIR}}
233
- run : ctest --output-on-failure --test-dir examples -C ${{matrix.build_type}}
234
-
235
- - name : Run benchmarks
236
- working-directory : ${{env.BUILD_DIR}}
237
- run : ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
238
-
239
- - name : Check coverage
240
- if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
241
- working-directory : ${{env.BUILD_DIR}}
242
- run : |
243
- export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
244
- echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
245
- ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
246
- mkdir -p ${{env.COVERAGE_DIR}}
247
- mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
248
-
249
- - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
250
- if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
251
- with :
252
- name : ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
253
- path : ${{env.COVERAGE_DIR}}
0 commit comments