Skip to content

Commit cb25fde

Browse files
Merge pull request #1442 from bratpiorka/rrudnick_debug_rel_gpu
build and test Debug and Release configs in single job
2 parents fe3aea6 + aaff7e7 commit cb25fde

File tree

2 files changed

+149
-62
lines changed

2 files changed

+149
-62
lines changed

.github/workflows/reusable_basic.yml

Lines changed: 84 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,15 @@ jobs:
232232
233233
windows-build:
234234
env:
235-
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"
236-
VCPKG_PATH_BIN: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows/bin;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows/bin;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows/bin"
235+
BUILD_DEBUG_DIR : "${{github.workspace}}/debug/build"
236+
INSTL_DEBUG_DIR : "${{github.workspace}}/debug/install-dir"
237+
BUILD_RELEASE_DIR : "${{github.workspace}}/release/build"
238+
INSTL_RELEASE_DIR : "${{github.workspace}}/release/install-dir"
239+
VCPKG_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows"
240+
VCPKG_PATH_BIN: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows/bin;${{github.workspace}}/vcpkg/packages/tbb_x64-windows/bin;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows/bin"
237241
strategy:
238242
matrix:
239243
os: ['windows-2022', 'windows-2025']
240-
build_type: [Debug, Release]
241244
compiler: [{c: cl, cxx: cl}]
242245
shared_library: ['ON', 'OFF']
243246
level_zero_provider: ['ON']
@@ -246,30 +249,34 @@ jobs:
246249
# extra job: Custom (old) CMake, clang-cl compiler
247250
# Note: This CMake uses NMake generator as VS paths are probably messed up (by CMake?)
248251
- os: 'windows-2025'
249-
build_type: Release
250-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release' # NMake generator requires this
252+
extra_release_build_type: '-DCMAKE_BUILD_TYPE=Release' # NMake generator requires this
251253
compiler: {c: clang-cl, cxx: clang-cl}
252254
shared_library: 'ON'
253255
level_zero_provider: 'ON'
254256
cuda_provider: 'ON'
255257
cmake_ver: '3.14.0-win64-x64'
256258
# extra job: Custom CMake, L0/CUDA providers disabled
257259
- os: 'windows-2025'
258-
build_type: Release
259260
compiler: {c: cl, cxx: cl}
260261
shared_library: 'ON'
261262
level_zero_provider: 'OFF'
262263
cuda_provider: 'OFF'
263264
cmake_ver: '3.28.0-windows-x86_64'
264265
# umfd enabled (this job will replace one from matrix)
265266
- os: 'windows-2022'
266-
build_type: Release
267267
compiler: {c: cl, cxx: cl}
268268
shared_library: 'ON'
269269
level_zero_provider: 'ON'
270270
cuda_provider: 'ON'
271271
umfd_lib: 'ON'
272-
name: Basic (${{matrix.os}}, build_type=${{matrix.build_type}}, compilers=${{matrix.compiler.c}}/${{matrix.compiler.cxx}}, shared_library=${{matrix.shared_library}}, level_zero_provider=${{matrix.level_zero_provider}}, cuda_provider=${{matrix.cuda_provider}}, cmake_ver=${{matrix.cmake_ver || 'default'}}, umfd=${{matrix.umfd_lib || 'OFF'}})
272+
name: Basic (${{matrix.os}},
273+
compilers=${{matrix.compiler.c}}/${{matrix.compiler.cxx}},
274+
shared_library=${{matrix.shared_library}},
275+
level_zero_provider=${{matrix.level_zero_provider}},
276+
cuda_provider=${{matrix.cuda_provider}},
277+
cmake_ver=${{matrix.cmake_ver || 'default'}},
278+
umfd=${{matrix.umfd_lib || 'OFF'}})
279+
extra=${{matrix.extra_release_build_type || ''}}
273280
runs-on: ${{matrix.os}}
274281

275282
steps:
@@ -308,7 +315,7 @@ jobs:
308315
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
309316
with:
310317
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
311-
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
318+
vcpkgDirectory: ${{github.workspace}}/vcpkg
312319
vcpkgJsonGlob: '**/vcpkg.json'
313320

314321
# Install the dependencies and add the bin folders to the PATH for older
@@ -326,12 +333,11 @@ jobs:
326333
echo "UMF_VERSION=$version" >> $env:GITHUB_ENV
327334
shell: pwsh
328335

329-
- name: Configure build
336+
- name: Configure build (Debug)
330337
run: >
331338
cmake
332-
-B ${{env.BUILD_DIR}}
333-
${{matrix.extra_build_options || ''}}
334-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
339+
-B ${{env.BUILD_DEBUG_DIR}}
340+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DEBUG_DIR}}"
335341
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
336342
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
337343
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
@@ -344,11 +350,11 @@ jobs:
344350
-DUMF_TESTS_FAIL_ON_SKIP=ON
345351
-DUMF_USE_DEBUG_POSTFIX=${{matrix.umfd_lib || 'OFF'}}
346352
347-
- name: Build UMF
348-
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
353+
- name: Build UMF (Debug)
354+
run: cmake --build ${{env.BUILD_DEBUG_DIR}} --config Debug -j $Env:NUMBER_OF_PROCESSORS
349355

350-
- name: Run tests
351-
working-directory: ${{env.BUILD_DIR}}
356+
- name: Run tests (Debug)
357+
working-directory: ${{env.BUILD_DEBUG_DIR}}
352358
# For CMake versions < 3.22 we have to add the build directory to the PATH manually
353359
# Extra paths without 'build_type' are set for NMake generator
354360
run: |
@@ -357,33 +363,83 @@ jobs:
357363
$major = [int]$m.groups[1].Value
358364
$minor = [int]$m.groups[2].Value
359365
if ($major -lt 3 -or ($major -eq 3 -and $minor -lt 22)) {
360-
$env:Path = "${{env.BUILD_DIR}}/bin/${{matrix.build_type}};${{env.BUILD_DIR}}/src/proxy_lib/${{matrix.build_type}};$env:Path"
361-
$env:Path = "${{env.BUILD_DIR}}/bin/;${{env.BUILD_DIR}}/src/proxy_lib/;$env:Path"
366+
$env:Path = "${{env.BUILD_DEBUG_DIR}}/bin/Debug;${{env.BUILD_DEBUG_DIR}}/src/proxy_lib/Debug;$env:Path"
367+
$env:Path = "${{env.BUILD_DEBUG_DIR}}/bin/;${{env.BUILD_DEBUG_DIR}}/src/proxy_lib/;$env:Path"
362368
echo "PATH=$env:Path" >> $env:GITHUB_ENV
363369
}
364370
}
365-
ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
371+
ctest -C Debug --output-on-failure --test-dir test
366372
shell: pwsh
367373

368-
- name: Test UMF installation and uninstallation
374+
- name: Test UMF installation and uninstallation (Debug)
369375
run: >
370376
python3 ${{github.workspace}}/test/test_installation.py
371-
--build-dir ${{env.BUILD_DIR}}
372-
--install-dir ${{env.INSTL_DIR}}
373-
--build-type ${{matrix.build_type}}
377+
--build-dir ${{env.BUILD_DEBUG_DIR}}
378+
--install-dir ${{env.INSTL_DEBUG_DIR}}
379+
--build-type Debug
374380
${{matrix.shared_library == 'ON' && '--proxy' || '' }}
375381
--umf-version ${{env.UMF_VERSION}}
376382
${{ matrix.shared_library == 'ON' && '--shared-library' || ''}}
377383
${{ matrix.umfd_lib == 'ON' && '--umfd-lib' || ''}}
378384
379-
- name: check /DEPENDENTLOADFLAG in umf.dll
385+
- name: Configure build (Release)
386+
run: >
387+
cmake
388+
-B ${{env.BUILD_RELEASE_DIR}}
389+
${{matrix.extra_release_build_type || ''}}
390+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_RELEASE_DIR}}"
391+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
392+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
393+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
394+
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
395+
-DUMF_FORMAT_CODE_STYLE=OFF
396+
-DUMF_DEVELOPER_MODE=ON
397+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
398+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
399+
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}}
400+
-DUMF_TESTS_FAIL_ON_SKIP=ON
401+
-DUMF_USE_DEBUG_POSTFIX=${{matrix.umfd_lib || 'OFF'}}
402+
403+
- name: Build UMF (Release)
404+
run: cmake --build ${{env.BUILD_RELEASE_DIR}} --config Release -j $Env:NUMBER_OF_PROCESSORS
405+
406+
- name: Run tests (Release)
407+
working-directory: ${{env.BUILD_RELEASE_DIR}}
408+
# For CMake versions < 3.22 we have to add the build directory to the PATH manually
409+
# Extra paths without 'build_type' are set for NMake generator
410+
run: |
411+
$m = [regex]::Matches((cmake --version), "cmake version (\d+)\.(\d+)\.(\d+)")
412+
if ($m) {
413+
$major = [int]$m.groups[1].Value
414+
$minor = [int]$m.groups[2].Value
415+
if ($major -lt 3 -or ($major -eq 3 -and $minor -lt 22)) {
416+
$env:Path = "${{env.BUILD_RELEASE_DIR}}/bin/Release;${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/Release;$env:Path"
417+
$env:Path = "${{env.BUILD_RELEASE_DIR}}/bin/;${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/;$env:Path"
418+
echo "PATH=$env:Path" >> $env:GITHUB_ENV
419+
}
420+
}
421+
ctest -C Release --output-on-failure --test-dir test
422+
shell: pwsh
423+
424+
- name: Test UMF installation and uninstallation (Release)
425+
run: >
426+
python3 ${{github.workspace}}/test/test_installation.py
427+
--build-dir ${{env.BUILD_RELEASE_DIR}}
428+
--install-dir ${{env.INSTL_RELEASE_DIR}}
429+
--build-type Release
430+
${{matrix.shared_library == 'ON' && '--proxy' || '' }}
431+
--umf-version ${{env.UMF_VERSION}}
432+
${{ matrix.shared_library == 'ON' && '--shared-library' || ''}}
433+
${{ matrix.umfd_lib == 'ON' && '--umfd-lib' || ''}}
434+
435+
- name: check /DEPENDENTLOADFLAG in umf.dll (Release)
380436
if: ${{matrix.shared_library == 'ON' && matrix.compiler.cxx == 'cl'}}
381-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll
437+
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_RELEASE_DIR}}/bin/Release/umf.dll
382438
shell: pwsh
383439

384-
- name: check /DEPENDENTLOADFLAG in umf_proxy.dll
440+
- name: check /DEPENDENTLOADFLAG in umf_proxy.dll (Release)
385441
if: ${{matrix.shared_library == 'ON' && matrix.compiler.cxx == 'cl'}}
386-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/src/proxy_lib/${{matrix.build_type}}/umf_proxy.dll
442+
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/Release/umf_proxy.dll
387443
shell: pwsh
388444

389445
windows-dynamic_build_hwloc:

.github/workflows/reusable_gpu.yml

Lines changed: 65 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ on:
1717
description: A list of OSes
1818
type: string
1919
default: "['Ubuntu', 'Windows']"
20-
build_type:
21-
description: A list of build types
22-
type: string
23-
default: "['Debug', 'Release']"
2420
shared_lib:
2521
description: A list of options for building shared library
2622
type: string
@@ -30,14 +26,16 @@ permissions:
3026
contents: read
3127

3228
env:
33-
BUILD_DIR : "${{github.workspace}}/build"
34-
INSTL_DIR : "${{github.workspace}}/install-dir"
29+
BUILD_DEBUG_DIR : "${{github.workspace}}/debug/build"
30+
BUILD_RELEASE_DIR : "${{github.workspace}}/release/build"
31+
INSTL_DEBUG_DIR : "${{github.workspace}}/debug/install-dir"
32+
INSTL_RELEASE_DIR : "${{github.workspace}}/release/install-dir"
3533
COVERAGE_DIR : "${{github.workspace}}/coverage"
3634

3735
jobs:
3836
gpu:
3937
env:
40-
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+
VCPKG_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows;"
4139
COVERAGE_NAME : "exports-coverage-${{inputs.provider}}-${{inputs.runner}}"
4240
# run only on upstream; forks will not have the HW
4341
if: github.repository == 'oneapi-src/unified-memory-framework'
@@ -46,8 +44,7 @@ jobs:
4644
matrix:
4745
shared_library: ${{ fromJSON(inputs.shared_lib)}}
4846
os: ${{ fromJSON(inputs.os)}}
49-
build_type: ${{ fromJSON(inputs.build_type)}}
50-
name: GPU (${{matrix.os}}, build_type=${{matrix.build_type}}, shared=${{matrix.shared_library}})
47+
name: GPU (${{matrix.os}}, shared=${{matrix.shared_library}})
5148
runs-on: ["DSS-${{inputs.runner}}", "DSS-${{matrix.os}}"]
5249

5350
steps:
@@ -72,7 +69,7 @@ jobs:
7269
with:
7370
fetch-depth: 0
7471

75-
- name: Get information about platform
72+
- name: "[Lin] Get information about platform"
7673
if: matrix.os == 'Ubuntu'
7774
run: .github/scripts/get_system_info.sh
7875

@@ -81,7 +78,7 @@ jobs:
8178
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
8279
with:
8380
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
84-
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
81+
vcpkgDirectory: ${{github.workspace}}/vcpkg
8582
vcpkgJsonGlob: '**/vcpkg.json'
8683

8784
- name: "[Win] Install dependencies"
@@ -90,13 +87,48 @@ jobs:
9087

9188
# note: disable all providers except the one being tested
9289
# '-DCMAKE_SUPPRESS_REGENERATION=ON' is the WA for the error: "CUSTOMBUILD : CMake error : Cannot restore timestamp"
93-
- name: Configure build
90+
- name: Configure build (Debug)
91+
run: >
92+
cmake
93+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
94+
-B ${{env.BUILD_DEBUG_DIR}}
95+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DEBUG_DIR}}"
96+
-DCMAKE_BUILD_TYPE=Debug
97+
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
98+
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
99+
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
100+
-DUMF_BUILD_BENCHMARKS=ON
101+
-DUMF_BUILD_BENCHMARKS_MT=ON
102+
-DUMF_BUILD_TESTS=ON
103+
-DUMF_BUILD_GPU_TESTS=ON
104+
-DUMF_BUILD_GPU_EXAMPLES=ON
105+
-DUMF_DEVELOPER_MODE=ON
106+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
107+
-DUMF_BUILD_CUDA_PROVIDER=OFF
108+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
109+
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
110+
-DUMF_TESTS_FAIL_ON_SKIP=ON
111+
${{ matrix.os == 'Ubuntu' && '-DUMF_USE_COVERAGE=ON' || '' }}
112+
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}
113+
114+
- name: Build UMF (Debug)
115+
run: cmake --build ${{env.BUILD_DEBUG_DIR}} --config Debug -j ${{env.PROCS}}
116+
117+
- name: Run tests (Debug)
118+
working-directory: ${{env.BUILD_DEBUG_DIR}}
119+
run: ctest -C Debug --output-on-failure --test-dir test
120+
121+
- name: Run examples (Debug)
122+
working-directory: ${{env.BUILD_DEBUG_DIR}}
123+
run: ctest --output-on-failure --test-dir examples -C Debug
124+
125+
- name: Configure build (Release)
94126
run: >
95127
cmake
96128
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
97-
-B ${{env.BUILD_DIR}}
98-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
99-
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
129+
-B ${{env.BUILD_RELEASE_DIR}}
130+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_RELEASE_DIR}}"
131+
-DCMAKE_BUILD_TYPE=Release
100132
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
101133
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
102134
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
@@ -111,37 +143,36 @@ jobs:
111143
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
112144
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
113145
-DUMF_TESTS_FAIL_ON_SKIP=ON
114-
${{ matrix.os == 'Ubuntu' && matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
115146
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}
116147
117-
- name: Build UMF
118-
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{env.PROCS}}
148+
- name: Build UMF (Release)
149+
run: cmake --build ${{env.BUILD_RELEASE_DIR}} --config Release -j ${{env.PROCS}}
119150

120-
- name: Run tests
121-
working-directory: ${{env.BUILD_DIR}}
122-
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
151+
- name: Run tests (Release)
152+
working-directory: ${{env.BUILD_RELEASE_DIR}}
153+
run: ctest -C Release --output-on-failure --test-dir test
123154

124-
- name: Run examples
125-
working-directory: ${{env.BUILD_DIR}}
126-
run: ctest --output-on-failure --test-dir examples -C ${{matrix.build_type}}
155+
- name: Run examples (Release)
156+
working-directory: ${{env.BUILD_RELEASE_DIR}}
157+
run: ctest --output-on-failure --test-dir examples -C Release
127158

128-
- name: Run benchmarks
129-
if: matrix.build_type == 'Release'
130-
working-directory: ${{env.BUILD_DIR}}
131-
run: ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-multithreaded
159+
- name: Run benchmarks (Release)
160+
working-directory: ${{env.BUILD_RELEASE_DIR}}
161+
run: ctest --output-on-failure --test-dir benchmark -C Release --exclude-regex umf-multithreaded
132162

133-
- name: Check coverage
134-
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
135-
working-directory: ${{env.BUILD_DIR}}
163+
- name: "[Lin] Check coverage (Debug)"
164+
if: ${{ matrix.os == 'Ubuntu' }}
165+
working-directory: ${{env.BUILD_DEBUG_DIR}}
136166
run: |
137167
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
138168
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
139-
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
169+
${{github.workspace}}/scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
140170
mkdir -p ${{env.COVERAGE_DIR}}
141171
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
142172
143-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
144-
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
173+
- name: "[Lin] Upload coverage"
174+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
175+
if: ${{ matrix.os == 'Ubuntu' }}
145176
with:
146177
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
147178
path: ${{env.COVERAGE_DIR}}

0 commit comments

Comments
 (0)