Skip to content

Commit fcf3a5b

Browse files
committed
a
1 parent 0c44ef6 commit fcf3a5b

File tree

12 files changed

+302
-245
lines changed

12 files changed

+302
-245
lines changed

.github/workflows/pr_push.yml

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,88 +16,88 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
CodeChecks:
20-
uses: ./.github/workflows/reusable_checks.yml
21-
FastBuild:
22-
name: Fast builds
23-
needs: [CodeChecks]
24-
uses: ./.github/workflows/reusable_fast.yml
25-
Build:
26-
name: Basic builds
27-
needs: [FastBuild]
28-
uses: ./.github/workflows/reusable_basic.yml
29-
DevDax:
30-
needs: [FastBuild]
31-
uses: ./.github/workflows/reusable_dax.yml
32-
MultiNuma:
33-
needs: [FastBuild]
34-
uses: ./.github/workflows/reusable_multi_numa.yml
19+
#CodeChecks:
20+
# uses: ./.github/workflows/reusable_checks.yml
21+
#FastBuild:
22+
# name: Fast builds
23+
# needs: [CodeChecks]
24+
# uses: ./.github/workflows/reusable_fast.yml
25+
#Build:
26+
# name: Basic builds
27+
# needs: [FastBuild]
28+
# uses: ./.github/workflows/reusable_basic.yml
29+
#DevDax:
30+
# needs: [FastBuild]
31+
# uses: ./.github/workflows/reusable_dax.yml
32+
#MultiNuma:
33+
# needs: [FastBuild]
34+
# uses: ./.github/workflows/reusable_multi_numa.yml
3535
L0:
36-
needs: [Build]
36+
#needs: [Build]
3737
uses: ./.github/workflows/reusable_gpu.yml
3838
with:
3939
provider: "LEVEL_ZERO"
4040
runner: "L0"
4141
shared_lib: "['ON']"
4242
L0-BMG:
43-
needs: [Build]
43+
# needs: [Build]
4444
uses: ./.github/workflows/reusable_gpu.yml
4545
with:
4646
provider: "LEVEL_ZERO"
4747
runner: "L0-BMG"
4848
shared_lib: "['ON']"
4949
os: "['Ubuntu']"
5050
CUDA:
51-
needs: [Build]
51+
#needs: [Build]
5252
uses: ./.github/workflows/reusable_gpu.yml
5353
with:
5454
provider: "CUDA"
5555
runner: "CUDA"
5656
shared_lib: "['ON']"
57-
Sanitizers:
58-
needs: [FastBuild]
59-
uses: ./.github/workflows/reusable_sanitizers.yml
60-
QEMU:
61-
needs: [FastBuild]
62-
uses: ./.github/workflows/reusable_qemu.yml
63-
with:
64-
short_run: true
65-
ProxyLib:
66-
needs: [Build]
67-
uses: ./.github/workflows/reusable_proxy_lib.yml
68-
Valgrind:
69-
needs: [Build]
70-
uses: ./.github/workflows/reusable_valgrind.yml
71-
Coverage:
72-
# total coverage (on upstream only)
73-
if: github.repository == 'oneapi-src/unified-memory-framework'
74-
needs: [Build, DevDax, L0, CUDA, MultiNuma, QEMU, ProxyLib]
75-
uses: ./.github/workflows/reusable_coverage.yml
76-
secrets: inherit
77-
with:
78-
trigger: "${{github.event_name}}"
79-
Coverage_partial:
80-
# partial coverage (on forks)
81-
if: github.repository != 'oneapi-src/unified-memory-framework'
82-
needs: [Build, QEMU, ProxyLib]
83-
uses: ./.github/workflows/reusable_coverage.yml
84-
CodeQL:
85-
needs: [Build]
86-
permissions:
87-
contents: read
88-
security-events: write
89-
uses: ./.github/workflows/reusable_codeql.yml
90-
Trivy:
91-
needs: [Build]
92-
permissions:
93-
contents: read
94-
security-events: write
95-
uses: ./.github/workflows/reusable_trivy.yml
96-
Compatibility:
97-
needs: [Build]
98-
uses: ./.github/workflows/reusable_compatibility.yml
99-
strategy:
100-
matrix:
101-
tag: ["v0.11.0-rc1"]
102-
with:
103-
tag: ${{matrix.tag}}
57+
#Sanitizers:
58+
# needs: [FastBuild]
59+
# uses: ./.github/workflows/reusable_sanitizers.yml
60+
#QEMU:
61+
# needs: [FastBuild]
62+
# uses: ./.github/workflows/reusable_qemu.yml
63+
# with:
64+
# short_run: true
65+
#ProxyLib:
66+
# needs: [Build]
67+
# uses: ./.github/workflows/reusable_proxy_lib.yml
68+
#Valgrind:
69+
# needs: [Build]
70+
# uses: ./.github/workflows/reusable_valgrind.yml
71+
#Coverage:
72+
# # total coverage (on upstream only)
73+
# if: github.repository == 'oneapi-src/unified-memory-framework'
74+
# needs: [Build, DevDax, L0, CUDA, MultiNuma, QEMU, ProxyLib]
75+
# uses: ./.github/workflows/reusable_coverage.yml
76+
# secrets: inherit
77+
# with:
78+
# trigger: "${{github.event_name}}"
79+
#Coverage_partial:
80+
# # partial coverage (on forks)
81+
# if: github.repository != 'oneapi-src/unified-memory-framework'
82+
# needs: [Build, QEMU, ProxyLib]
83+
# uses: ./.github/workflows/reusable_coverage.yml
84+
#CodeQL:
85+
# needs: [Build]
86+
# permissions:
87+
# contents: read
88+
# security-events: write
89+
# uses: ./.github/workflows/reusable_codeql.yml
90+
#Trivy:
91+
# needs: [Build]
92+
# permissions:
93+
# contents: read
94+
# security-events: write
95+
# uses: ./.github/workflows/reusable_trivy.yml
96+
#Compatibility:
97+
# needs: [Build]
98+
# uses: ./.github/workflows/reusable_compatibility.yml
99+
# strategy:
100+
# matrix:
101+
# tag: ["v0.11.0-rc1"]
102+
# with:
103+
# tag: ${{matrix.tag}}

.github/workflows/reusable_basic.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
install_tbb: ['ON']
2727
disable_hwloc: ['OFF']
2828
link_hwloc_statically: ['OFF']
29+
cmake_ver: ['latest']
2930
include:
3031
- os: 'ubuntu-22.04'
3132
build_type: Release
@@ -36,6 +37,8 @@ jobs:
3637
install_tbb: 'ON'
3738
disable_hwloc: 'OFF'
3839
link_hwloc_statically: 'OFF'
40+
# check minimum supported cmake version
41+
cmake_ver: '3.14.0'
3942
- os: 'ubuntu-22.04'
4043
build_type: Release
4144
compiler: {c: gcc, cxx: g++}
@@ -45,6 +48,7 @@ jobs:
4548
install_tbb: 'ON'
4649
disable_hwloc: 'OFF'
4750
link_hwloc_statically: 'OFF'
51+
cmake_ver: 'latest'
4852
- os: 'ubuntu-24.04'
4953
build_type: Debug
5054
compiler: {c: gcc, cxx: g++}
@@ -54,6 +58,7 @@ jobs:
5458
install_tbb: 'ON'
5559
disable_hwloc: 'OFF'
5660
link_hwloc_statically: 'OFF'
61+
cmake_ver: 'latest'
5762
# test level_zero_provider='OFF' and cuda_provider='OFF'
5863
- os: 'ubuntu-22.04'
5964
build_type: Release
@@ -64,6 +69,7 @@ jobs:
6469
install_tbb: 'ON'
6570
disable_hwloc: 'OFF'
6671
link_hwloc_statically: 'OFF'
72+
cmake_ver: 'latest'
6773
# test icx compiler
6874
- os: 'ubuntu-22.04'
6975
build_type: Release
@@ -74,6 +80,7 @@ jobs:
7480
install_tbb: 'ON'
7581
disable_hwloc: 'OFF'
7682
link_hwloc_statically: 'OFF'
83+
cmake_ver: 'latest'
7784
# test lld linker
7885
- os: 'ubuntu-24.04'
7986
build_type: Release
@@ -85,7 +92,8 @@ jobs:
8592
disable_hwloc: 'OFF'
8693
link_hwloc_statically: 'OFF'
8794
llvm_linker: '-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld"'
88-
# test without installing TBB
95+
cmake_ver: 'latest'
96+
# test without installing TBB
8997
- os: 'ubuntu-22.04'
9098
build_type: Release
9199
compiler: {c: gcc, cxx: g++}
@@ -95,6 +103,7 @@ jobs:
95103
install_tbb: 'OFF'
96104
disable_hwloc: 'OFF'
97105
link_hwloc_statically: 'OFF'
106+
cmake_ver: 'latest'
98107
- os: 'ubuntu-22.04'
99108
build_type: Debug
100109
compiler: {c: gcc, cxx: g++}
@@ -104,6 +113,7 @@ jobs:
104113
install_tbb: 'ON'
105114
disable_hwloc: 'ON'
106115
link_hwloc_statically: 'OFF'
116+
cmake_ver: 'latest'
107117
- os: 'ubuntu-22.04'
108118
build_type: Release
109119
compiler: {c: gcc, cxx: g++}
@@ -113,6 +123,7 @@ jobs:
113123
install_tbb: 'ON'
114124
disable_hwloc: 'OFF'
115125
link_hwloc_statically: 'ON'
126+
cmake_ver: 'latest'
116127
runs-on: ${{matrix.os}}
117128

118129
steps:
@@ -124,7 +135,19 @@ jobs:
124135
- name: Install apt packages
125136
run: |
126137
sudo apt-get update
127-
sudo apt-get install -y clang cmake libnuma-dev lcov
138+
sudo apt-get install -y clang libnuma-dev lcov
139+
140+
- name: Install cmake (latest)
141+
if: matrix.cmake_ver == 'latest'
142+
run: |
143+
sudo apt-get install -y cmake
144+
145+
- name: Install cmake (minimum supported version)
146+
if: matrix.cmake_ver != 'latest'
147+
run: |
148+
wget https://github.com/Kitware/CMake/releases/download/v${{matrix.cmake_ver}}/cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh
149+
chmod +x cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh
150+
sudo ./cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh --skip-license --prefix=/usr/local
128151
129152
- name: Install hwloc
130153
if: matrix.disable_hwloc == 'OFF'

CMakeLists.txt

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5+
message(STATUS "CMake version: ${CMAKE_VERSION}")
56
cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)
7+
68
# needed when UMF is used as an external project
79
set(UMF_CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
810

@@ -404,16 +406,18 @@ if(UMF_BUILD_LEVEL_ZERO_PROVIDER AND (NOT UMF_LEVEL_ZERO_INCLUDE_DIR))
404406
GIT_REPOSITORY ${LEVEL_ZERO_LOADER_REPO}
405407
GIT_TAG ${LEVEL_ZERO_LOADER_TAG}
406408
EXCLUDE_FROM_ALL)
407-
FetchContent_MakeAvailable(level-zero-loader)
409+
# Only populate the repo - we don't need to build it TODO EXCLUDE_FROM_ALL
410+
# ver 3.28
411+
FetchContent_Populate(level-zero-loader)
408412

409413
set(LEVEL_ZERO_INCLUDE_DIRS
410414
${level-zero-loader_SOURCE_DIR}/include
411-
CACHE PATH "Path to Level Zero Headers")
412-
message(STATUS "Level Zero include directory: ${LEVEL_ZERO_INCLUDE_DIRS}")
415+
CACHE PATH "Path to Level Zero headers")
416+
message(STATUS "LEVEL_ZERO_INCLUDE_DIRS = ${LEVEL_ZERO_INCLUDE_DIRS}")
413417
elseif(UMF_BUILD_LEVEL_ZERO_PROVIDER)
414418
# Only header is needed to build UMF
415419
set(LEVEL_ZERO_INCLUDE_DIRS ${UMF_LEVEL_ZERO_INCLUDE_DIR})
416-
message(STATUS "Level Zero include directory: ${LEVEL_ZERO_INCLUDE_DIRS}")
420+
message(STATUS "LEVEL_ZERO_INCLUDE_DIRS = ${LEVEL_ZERO_INCLUDE_DIRS}")
417421
endif()
418422

419423
# Fetch CUDA only if needed i.e.: if building CUDA provider is ON and CUDA
@@ -423,14 +427,15 @@ if(UMF_BUILD_CUDA_PROVIDER AND (NOT UMF_CUDA_INCLUDE_DIR))
423427
"https://gitlab.com/nvidia/headers/cuda-individual/cudart.git")
424428
set(CUDA_TAG cuda-12.5.1)
425429

426-
message(STATUS "Fetching CUDA ${CUDA_TAG} from ${CUDA_REPO} ...")
430+
message(STATUS "Fetching CUDA (${CUDA_TAG}) from ${CUDA_REPO} ...")
427431

428432
FetchContent_Declare(
429433
cuda-headers
430434
GIT_REPOSITORY ${CUDA_REPO}
431435
GIT_TAG ${CUDA_TAG}
432436
EXCLUDE_FROM_ALL)
433-
FetchContent_MakeAvailable(cuda-headers)
437+
# Only populate the repo - we don't need to build it
438+
FetchContent_Populate(cuda-headers)
434439

435440
set(CUDA_INCLUDE_DIRS
436441
${cuda-headers_SOURCE_DIR}
@@ -707,16 +712,31 @@ else()
707712
)
708713
endif()
709714

710-
if((UMF_BUILD_GPU_TESTS OR UMF_BUILD_GPU_EXAMPLES) AND UMF_BUILD_CUDA_PROVIDER)
711-
find_package(CUDA REQUIRED cuda)
712-
if(CUDA_LIBRARIES)
713-
set(UMF_CUDA_ENABLED TRUE)
714-
else()
715-
message(
716-
STATUS "Disabling tests and examples that use the CUDA provider "
717-
"because the CUDA libraries they require were not found.")
715+
if(UMF_BUILD_GPU_TESTS OR UMF_BUILD_GPU_EXAMPLES)
716+
if(UMF_BUILD_CUDA_PROVIDER)
717+
find_package(CUDA REQUIRED cuda)
718+
if(CUDA_LIBRARIES)
719+
set(UMF_CUDA_ENABLED TRUE)
720+
else()
721+
message(
722+
STATUS
723+
"Disabling tests and examples that use the CUDA Provider "
724+
"because the CUDA libraries they require were not found.")
725+
endif()
726+
endif()
727+
728+
if(UMF_BUILD_LEVEL_ZERO_PROVIDER)
729+
find_package(ZE_LOADER REQUIRED ze_loader)
730+
if(ZE_LOADER_LIBRARIES)
731+
set(UMF_LEVEL_ZERO_ENABLED TRUE)
732+
else()
733+
message(
734+
STATUS
735+
"Disabling tests and examples that use the Level Zero Provider "
736+
"because the Level Zero libraries they require were not found."
737+
)
738+
endif()
718739
endif()
719-
# TODO do the same for ze_loader
720740
endif()
721741

722742
add_subdirectory(src)

0 commit comments

Comments
 (0)