4
4
5
5
name : GPU
6
6
7
- on : [workflow_call]
7
+ on :
8
+ workflow_call :
9
+ inputs :
10
+ name :
11
+ description : Provider name
12
+ type : string
13
+ required : true
14
+ os :
15
+ description : A list of OSes
16
+ type : string
17
+ required : true
18
+ build_type :
19
+ description : A list of build types
20
+ type : string
21
+ default : " ['Debug', 'Release']"
22
+ shared_lib :
23
+ description : A list of options for building shared library
24
+ type : string
25
+ default : " ['ON', 'OFF']"
8
26
9
27
permissions :
10
28
contents : read
15
33
COVERAGE_DIR : " ${{github.workspace}}/coverage"
16
34
17
35
jobs :
18
- gpu-Level-Zero :
19
- name : Level-Zero
36
+ gpu :
37
+ name : " ${{inputs.name}}: ${{matrix.os}}, ${{matrix.build_type}}, shared=${{matrix.shared_library}} "
20
38
env :
21
39
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 "
40
+ COVERAGE_NAME : " exports-coverage-${{inputs.name}} "
23
41
# run only on upstream; forks will not have the HW
24
42
if : github.repository == 'oneapi-src/unified-memory-framework'
25
43
strategy :
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
64
if : matrix.os == 'Ubuntu'
50
65
run : .github/scripts/get_system_info.sh
51
66
52
- - name : Configure build for Win
53
- if : matrix.os == 'Windows'
67
+ # note: disable all providers except the one being tested
68
+ - name : Configure build
54
69
run : >
55
70
cmake
56
71
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
@@ -64,36 +79,14 @@ jobs:
64
79
-DUMF_BUILD_TESTS=ON
65
80
-DUMF_BUILD_GPU_TESTS=ON
66
81
-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
79
- -B ${{env.BUILD_DIR}}
80
- -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
81
- -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
82
- -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
83
- -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
84
- -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
85
- -DUMF_BUILD_BENCHMARKS=ON
86
- -DUMF_BUILD_TESTS=ON
87
- -DUMF_BUILD_GPU_TESTS=ON
88
- -DUMF_BUILD_GPU_EXAMPLES=ON
89
- -DUMF_FORMAT_CODE_STYLE=OFF
90
82
-DUMF_DEVELOPER_MODE=ON
91
83
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
92
84
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
93
- -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
94
85
-DUMF_BUILD_CUDA_PROVIDER=OFF
86
+ -DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
87
+ -DUMF_BUILD_${{inputs.name}}_PROVIDER=ON
95
88
-DUMF_TESTS_FAIL_ON_SKIP=ON
96
- ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
89
+ ${{ matrix.os == 'Ubuntu' && matrix. build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
97
90
98
91
- name : Build UMF
99
92
run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}
@@ -111,7 +104,7 @@ jobs:
111
104
run : ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
112
105
113
106
- name : Check coverage
114
- if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
107
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
115
108
working-directory : ${{env.BUILD_DIR}}
116
109
run : |
117
110
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
@@ -121,88 +114,7 @@ jobs:
121
114
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
122
115
123
116
- uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
124
- if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
117
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
125
118
with :
126
- name : ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
119
+ name : ${{env.COVERAGE_NAME}}-${{matrix.os}}-${{matrix.build_type}}- shared-${{matrix.shared_library}}
127
120
path : ${{env.COVERAGE_DIR}}
128
-
129
- gpu-CUDA :
130
- name : CUDA
131
- env :
132
- COVERAGE_NAME : " exports-coverage-gpu-CUDA"
133
- # run only on upstream; forks will not have the HW
134
- if : github.repository == 'oneapi-src/unified-memory-framework'
135
- strategy :
136
- matrix :
137
- shared_library : ['ON', 'OFF']
138
- build_type : ['Debug', 'Release']
139
- # TODO add windows
140
- os : ['Ubuntu']
141
- include :
142
- - os : ' Ubuntu'
143
- compiler : {c: gcc, cxx: g++}
144
- number_of_processors : ' $(nproc)'
145
-
146
- runs-on : ["DSS-CUDA", "DSS-${{matrix.os}}"]
147
- steps :
148
- - name : Checkout
149
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
150
- with :
151
- fetch-depth : 0
152
-
153
- - name : Get information about platform
154
- if : matrix.os == 'Ubuntu'
155
- run : .github/scripts/get_system_info.sh
156
-
157
- - name : Configure build for Ubuntu
158
- if : matrix.os == 'Ubuntu'
159
- run : >
160
- cmake -B ${{env.BUILD_DIR}}
161
- -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
162
- -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
163
- -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
164
- -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
165
- -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
166
- -DUMF_BUILD_BENCHMARKS=ON
167
- -DUMF_BUILD_TESTS=ON
168
- -DUMF_BUILD_GPU_TESTS=ON
169
- -DUMF_BUILD_GPU_EXAMPLES=ON
170
- -DUMF_FORMAT_CODE_STYLE=OFF
171
- -DUMF_DEVELOPER_MODE=ON
172
- -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
173
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
174
- -DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
175
- -DUMF_BUILD_CUDA_PROVIDER=ON
176
- -DUMF_TESTS_FAIL_ON_SKIP=ON
177
- ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
178
-
179
- - name : Build UMF
180
- run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}
181
-
182
- - name : Run tests
183
- working-directory : ${{env.BUILD_DIR}}
184
- run : ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
185
-
186
- - name : Run examples
187
- working-directory : ${{env.BUILD_DIR}}
188
- run : ctest --output-on-failure --test-dir examples -C ${{matrix.build_type}}
189
-
190
- - name : Run benchmarks
191
- working-directory : ${{env.BUILD_DIR}}
192
- run : ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
193
-
194
- - name : Check coverage
195
- if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
196
- working-directory : ${{env.BUILD_DIR}}
197
- run : |
198
- export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
199
- echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
200
- ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
201
- mkdir -p ${{env.COVERAGE_DIR}}
202
- mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
203
-
204
- - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
205
- if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
206
- with :
207
- name : ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
208
- path : ${{env.COVERAGE_DIR}}
0 commit comments