@@ -12,26 +12,31 @@ permissions:
12
12
env :
13
13
BUILD_DIR : " ${{github.workspace}}/build"
14
14
INSTL_DIR : " ${{github.workspace}}/../install-dir"
15
+ COVERAGE_DIR : " ${{github.workspace}}/coverage"
15
16
16
17
jobs :
17
18
gpu :
18
19
name : Build
19
20
env :
20
- BUILD_TYPE : Release
21
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"
22
23
# run only on upstream; forks will not have the HW
23
24
if : github.repository == 'oneapi-src/unified-memory-framework'
24
25
strategy :
25
26
matrix :
26
27
shared_library : ['ON', 'OFF']
27
28
os : ['Ubuntu', 'Windows']
29
+ build_type : ['Debug', 'Release']
28
30
include :
29
31
- os : ' Ubuntu'
30
32
compiler : {c: gcc, cxx: g++}
31
33
number_of_processors : ' $(nproc)'
32
34
- os : ' Windows'
33
35
compiler : {c: cl, cxx: cl}
34
36
number_of_processors : ' $Env:NUMBER_OF_PROCESSORS'
37
+ exclude :
38
+ - os : ' Windows'
39
+ build_type : ' Debug'
35
40
36
41
runs-on : ["DSS-LEVEL_ZERO", "DSS-${{matrix.os}}"]
37
42
steps :
51
56
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
52
57
-B ${{env.BUILD_DIR}}
53
58
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
54
- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
59
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
55
60
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
56
61
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
57
62
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
73
78
cmake
74
79
-B ${{env.BUILD_DIR}}
75
80
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
76
- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
81
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
77
82
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
78
83
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
79
84
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -88,31 +93,49 @@ jobs:
88
93
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
89
94
-DUMF_BUILD_CUDA_PROVIDER=OFF
90
95
-DUMF_TESTS_FAIL_ON_SKIP=ON
96
+ ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
91
97
92
98
- name : Build UMF
93
- run : cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE }} -j ${{matrix.number_of_processors}}
99
+ run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type }} -j ${{matrix.number_of_processors}}
94
100
95
101
- name : Run tests
96
102
working-directory : ${{env.BUILD_DIR}}
97
- run : ctest -C ${{env.BUILD_TYPE }} --output-on-failure --test-dir test
103
+ run : ctest -C ${{matrix.build_type }} --output-on-failure --test-dir test
98
104
99
105
- name : Run examples
100
106
working-directory : ${{env.BUILD_DIR}}
101
- run : ctest --output-on-failure --test-dir examples -C ${{env.BUILD_TYPE }}
107
+ run : ctest --output-on-failure --test-dir examples -C ${{matrix.build_type }}
102
108
103
109
- name : Run benchmarks
104
110
working-directory : ${{env.BUILD_DIR}}
105
- run : ctest --output-on-failure --test-dir benchmark -C ${{env.BUILD_TYPE}} --exclude-regex umf-bench-multithreaded
111
+ run : ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
112
+
113
+ - name : Check coverage
114
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
115
+ working-directory : ${{env.BUILD_DIR}}
116
+ run : |
117
+ export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
118
+ echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
119
+ ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
120
+ mkdir -p ${{env.COVERAGE_DIR}}
121
+ mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
122
+
123
+ - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
124
+ if : ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
125
+ with :
126
+ name : ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
127
+ path : ${{env.COVERAGE_DIR}}
106
128
107
129
gpu-CUDA :
108
130
name : Build
109
131
env :
110
- BUILD_TYPE : Release
132
+ COVERAGE_NAME : " exports-coverage-gpu-CUDA "
111
133
# run only on upstream; forks will not have the HW
112
134
if : github.repository == 'oneapi-src/unified-memory-framework'
113
135
strategy :
114
136
matrix :
115
137
shared_library : ['ON', 'OFF']
138
+ build_type : ['Debug', 'Release']
116
139
# TODO add windows
117
140
os : ['Ubuntu']
118
141
include :
@@ -136,7 +159,7 @@ jobs:
136
159
run : >
137
160
cmake -B ${{env.BUILD_DIR}}
138
161
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
139
- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
162
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
140
163
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
141
164
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
142
165
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -151,18 +174,35 @@ jobs:
151
174
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
152
175
-DUMF_BUILD_CUDA_PROVIDER=ON
153
176
-DUMF_TESTS_FAIL_ON_SKIP=ON
177
+ ${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
154
178
155
179
- name : Build UMF
156
- run : cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE }} -j ${{matrix.number_of_processors}}
180
+ run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type }} -j ${{matrix.number_of_processors}}
157
181
158
182
- name : Run tests
159
183
working-directory : ${{env.BUILD_DIR}}
160
- run : ctest -C ${{env.BUILD_TYPE }} --output-on-failure --test-dir test
184
+ run : ctest -C ${{matrix.build_type }} --output-on-failure --test-dir test
161
185
162
186
- name : Run examples
163
187
working-directory : ${{env.BUILD_DIR}}
164
- run : ctest --output-on-failure --test-dir examples -C ${{env.BUILD_TYPE }}
188
+ run : ctest --output-on-failure --test-dir examples -C ${{matrix.build_type }}
165
189
166
190
- name : Run benchmarks
167
191
working-directory : ${{env.BUILD_DIR}}
168
- run : ctest --output-on-failure --test-dir benchmark -C ${{env.BUILD_TYPE}} --exclude-regex umf-bench-multithreaded
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