Skip to content

Commit 86ef1f5

Browse files
committed
Add GPU to Coverage
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent d80b89c commit 86ef1f5

File tree

3 files changed

+73
-14
lines changed

3 files changed

+73
-14
lines changed

.github/workflows/coverage.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,30 @@ jobs:
6363
name: exports-coverage-dax-shared-OFF
6464
path: coverage
6565

66+
- name: Download file exports-coverage-gpu-shared-ON
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: exports-coverage-gpu-shared-ON
70+
path: coverage
71+
72+
- name: Download file exports-coverage-gpu-shared-OFF
73+
uses: actions/download-artifact@v4
74+
with:
75+
name: exports-coverage-gpu-shared-OFF
76+
path: coverage
77+
78+
- name: Download file exports-coverage-gpu-CUDA-shared-ON
79+
uses: actions/download-artifact@v4
80+
with:
81+
name: exports-coverage-gpu-CUDA-shared-ON
82+
path: coverage
83+
84+
- name: Download file exports-coverage-gpu-CUDA-shared-OFF
85+
uses: actions/download-artifact@v4
86+
with:
87+
name: exports-coverage-gpu-CUDA-shared-OFF
88+
path: coverage
89+
6690
- name: Compute coverage
6791
working-directory: ${{env.COVERAGE_DIR}}
6892
run: |

.github/workflows/gpu.yml

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,21 @@ permissions:
1212
env:
1313
BUILD_DIR : "${{github.workspace}}/build"
1414
INSTL_DIR : "${{github.workspace}}/../install-dir"
15+
COVERAGE_DIR : "${{github.workspace}}/coverage"
1516

1617
jobs:
1718
gpu:
1819
name: Build
1920
env:
20-
BUILD_TYPE: Release
2121
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"
2223
# run only on upstream; forks will not have the HW
2324
if: github.repository == 'oneapi-src/unified-memory-framework'
2425
strategy:
2526
matrix:
2627
shared_library: ['ON', 'OFF']
2728
os: ['Ubuntu', 'Windows']
29+
build_type: ['Debug', 'Release']
2830
include:
2931
- os: 'Ubuntu'
3032
compiler: {c: gcc, cxx: g++}
@@ -51,7 +53,7 @@ jobs:
5153
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
5254
-B ${{env.BUILD_DIR}}
5355
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
54-
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
56+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
5557
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
5658
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
5759
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -73,7 +75,7 @@ jobs:
7375
cmake
7476
-B ${{env.BUILD_DIR}}
7577
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
76-
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
78+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
7779
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
7880
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
7981
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -90,29 +92,46 @@ jobs:
9092
-DUMF_TESTS_FAIL_ON_SKIP=ON
9193
9294
- name: Build UMF
93-
run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} -j ${{matrix.number_of_processors}}
95+
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}
9496

9597
- name: Run tests
9698
working-directory: ${{env.BUILD_DIR}}
97-
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure --test-dir test
99+
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
98100

99101
- name: Run examples
100102
working-directory: ${{env.BUILD_DIR}}
101-
run: ctest --output-on-failure --test-dir examples -C ${{env.BUILD_TYPE}}
103+
run: ctest --output-on-failure --test-dir examples -C ${{matrix.build_type}}
102104

103105
- name: Run benchmarks
104106
working-directory: ${{env.BUILD_DIR}}
105-
run: ctest --output-on-failure --test-dir benchmark -C ${{env.BUILD_TYPE}} --exclude-regex umf-bench-multithreaded
107+
run: ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
108+
109+
- name: Check coverage
110+
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
111+
working-directory: ${{env.BUILD_DIR}}
112+
run: |
113+
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
114+
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
115+
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
116+
mkdir -p ${{env.COVERAGE_DIR}}
117+
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
118+
119+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
120+
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
121+
with:
122+
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
123+
path: ${{env.COVERAGE_DIR}}
106124

107125
gpu-CUDA:
108126
name: Build
109127
env:
110-
BUILD_TYPE: Release
128+
COVERAGE_NAME : "exports-coverage-gpu-CUDA"
111129
# run only on upstream; forks will not have the HW
112130
if: github.repository == 'oneapi-src/unified-memory-framework'
113131
strategy:
114132
matrix:
115133
shared_library: ['ON', 'OFF']
134+
build_type: ['Debug', 'Release']
116135
# TODO add windows
117136
os: ['Ubuntu']
118137
include:
@@ -136,7 +155,7 @@ jobs:
136155
run: >
137156
cmake -B ${{env.BUILD_DIR}}
138157
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
139-
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
158+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
140159
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
141160
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
142161
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -153,16 +172,32 @@ jobs:
153172
-DUMF_TESTS_FAIL_ON_SKIP=ON
154173
155174
- name: Build UMF
156-
run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} -j ${{matrix.number_of_processors}}
175+
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}
157176

158177
- name: Run tests
159178
working-directory: ${{env.BUILD_DIR}}
160-
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure --test-dir test
179+
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
161180

162181
- name: Run examples
163182
working-directory: ${{env.BUILD_DIR}}
164-
run: ctest --output-on-failure --test-dir examples -C ${{env.BUILD_TYPE}}
183+
run: ctest --output-on-failure --test-dir examples -C ${{matrix.build_type}}
165184

166185
- name: Run benchmarks
167186
working-directory: ${{env.BUILD_DIR}}
168-
run: ctest --output-on-failure --test-dir benchmark -C ${{env.BUILD_TYPE}} --exclude-regex umf-bench-multithreaded
187+
run: ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
188+
189+
- name: Check coverage
190+
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
191+
working-directory: ${{env.BUILD_DIR}}
192+
run: |
193+
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
194+
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
195+
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
196+
mkdir -p ${{env.COVERAGE_DIR}}
197+
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
198+
199+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
200+
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
201+
with:
202+
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
203+
path: ${{env.COVERAGE_DIR}}

.github/workflows/pr_push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,5 @@ jobs:
111111
needs: [Build]
112112
uses: ./.github/workflows/multi_numa.yml
113113
Coverage:
114-
needs: [Build, DevDax]
114+
needs: [Build, DevDax, GPU]
115115
uses: ./.github/workflows/coverage.yml

0 commit comments

Comments
 (0)