Skip to content

Commit 80db0ed

Browse files
committed
a
1 parent 4a93eeb commit 80db0ed

19 files changed

+189
-306
lines changed

.github/workflows/pr_push.yml

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -16,88 +16,6 @@ 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
35-
L0:
36-
needs: [Build]
37-
uses: ./.github/workflows/reusable_gpu.yml
38-
with:
39-
provider: "LEVEL_ZERO"
40-
runner: "L0"
41-
shared_lib: "['ON']"
42-
L0-BMG:
43-
needs: [Build]
44-
uses: ./.github/workflows/reusable_gpu.yml
45-
with:
46-
provider: "LEVEL_ZERO"
47-
runner: "L0-BMG"
48-
shared_lib: "['ON']"
49-
os: "['Ubuntu']"
50-
CUDA:
51-
needs: [Build]
52-
uses: ./.github/workflows/reusable_gpu.yml
53-
with:
54-
provider: "CUDA"
55-
runner: "CUDA"
56-
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
19+
6820
Valgrind:
69-
needs: [Build]
7021
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}}

CMakeLists.txt

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,23 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio" OR CMAKE_GENERATOR MATCHES
632632
set(CMAKE_UMF_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/$<CONFIG>)
633633
endif()
634634

635+
# valgrind
636+
if(UMF_USE_VALGRIND)
637+
if(UMF_USE_ASAN
638+
OR UMF_USE_TSAN
639+
OR UMF_USE_UBSAN
640+
OR UMF_USE_MSAN)
641+
message(FATAL_ERROR "Cannot use valgrind and sanitizers together")
642+
endif()
643+
644+
if(PkgConfig_FOUND)
645+
pkg_check_modules(VALGRIND valgrind)
646+
endif()
647+
if(NOT VALGRIND_FOUND)
648+
find_package(VALGRIND REQUIRED valgrind)
649+
endif()
650+
endif()
651+
635652
# Sanitizer flags
636653
if(UMF_USE_ASAN)
637654
add_sanitizer_flag(address)
@@ -953,12 +970,11 @@ if(UMF_FORMAT_CODE_STYLE)
953970
COMMENT "Format C/C++, CMake, and Python files")
954971
message(
955972
STATUS
956-
" Adding convenience targets 'format-check' and 'format-apply'."
957-
)
973+
"Adding convenience targets 'format-check' and 'format-apply'.")
958974
else()
959975
message(
960976
STATUS
961-
" Convenience targets 'format-check' and 'format-apply' are "
977+
"Convenience targets 'format-check' and 'format-apply' are "
962978
"not available. Use commands specific for found tools (see the log above)."
963979
)
964980
endif()

_deps/cuda-headers-src

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit a63ea57e87ec813c7f77c2b298a9df23a1af152a

_deps/googletest-src

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit b514bdc898e2951020cbdca1304b75f5950d1f59

cmake/FindCUDA.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ else()
3434
if(CUDA_FIND_REQUIRED)
3535
message(FATAL_ERROR ${MSG_NOT_FOUND})
3636
else()
37-
message(WARNING ${MSG_NOT_FOUND})
37+
message(STATUS ${MSG_NOT_FOUND})
3838
endif()
3939
endif()

cmake/FindJEMALLOC.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ else()
2323
if(JEMALLOC_FIND_REQUIRED)
2424
message(FATAL_ERROR ${MSG_NOT_FOUND})
2525
else()
26-
message(WARNING ${MSG_NOT_FOUND})
26+
message(STATUS ${MSG_NOT_FOUND})
2727
endif()
2828
endif()
2929

@@ -41,6 +41,6 @@ else()
4141
if(JEMALLOC_FIND_REQUIRED)
4242
message(FATAL_ERROR ${MSG_NOT_FOUND})
4343
else()
44-
message(WARNING ${MSG_NOT_FOUND})
44+
message(STATUS ${MSG_NOT_FOUND})
4545
endif()
4646
endif()

cmake/FindLIBHWLOC.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ else()
7676
if(LIBHWLOC_FIND_REQUIRED)
7777
message(FATAL_ERROR ${MSG_NOT_FOUND})
7878
else()
79-
message(WARNING ${MSG_NOT_FOUND})
79+
message(STATUS ${MSG_NOT_FOUND})
8080
endif()
8181
endif()

cmake/FindLIBNUMA.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -15,6 +15,6 @@ else()
1515
if(LIBNUMA_FIND_REQUIRED)
1616
message(FATAL_ERROR ${MSG_NOT_FOUND})
1717
else()
18-
message(WARNING ${MSG_NOT_FOUND})
18+
message(STATUS ${MSG_NOT_FOUND})
1919
endif()
2020
endif()

cmake/FindTBB.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -21,7 +21,7 @@ else()
2121
if(TBB_FIND_REQUIRED)
2222
message(FATAL_ERROR ${MSG_NOT_FOUND})
2323
else()
24-
message(WARNING ${MSG_NOT_FOUND})
24+
message(STATUS ${MSG_NOT_FOUND})
2525
endif()
2626
endif()
2727

cmake/FindZE_LOADER.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ else()
3434
if(ZE_LOADER_FIND_REQUIRED)
3535
message(FATAL_ERROR ${MSG_NOT_FOUND})
3636
else()
37-
message(WARNING ${MSG_NOT_FOUND})
37+
message(STATUS ${MSG_NOT_FOUND})
3838
endif()
3939
endif()

cmake/helpers.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ endfunction()
225225

226226
function(add_umf_target_compile_options name)
227227
check_add_target_compile_options(${name} "-Wno-covered-switch-default")
228-
228+
target_compile_definitions(${name}
229+
PRIVATE ${UMF_COMMON_COMPILE_DEFINITIONS})
229230
if(NOT MSVC)
230231
target_compile_options(
231232
${name}
@@ -260,6 +261,10 @@ function(add_umf_target_compile_options name)
260261
-g -O0)
261262
endif()
262263
endif()
264+
if(UMF_USE_VALGRIND)
265+
target_compile_definitions(${name} PRIVATE "UMF_VG_ENABLED=1")
266+
target_include_directories(${name} PRIVATE ${VALGRIND_INCLUDE_DIRS})
267+
endif()
263268
elseif(MSVC)
264269
target_compile_options(
265270
${name}
@@ -386,6 +391,7 @@ function(add_umf_library)
386391
target_include_directories(
387392
${ARG_NAME}
388393
PRIVATE ${UMF_CMAKE_SOURCE_DIR}/include
394+
${UMF_CMAKE_SOURCE_DIR}/src
389395
${UMF_CMAKE_SOURCE_DIR}/src/utils
390396
${UMF_CMAKE_SOURCE_DIR}/src/base_alloc
391397
${UMF_CMAKE_SOURCE_DIR}/src/coarse)

src/CMakeLists.txt

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,16 @@ set(UMF_COMMON_COMPILE_DEFINITIONS
3030
${UMF_COMMON_COMPILE_DEFINITIONS} UMF_VERSION=${UMF_VERSION}
3131
UMF_ALL_CMAKE_VARIABLES="${UMF_ALL_CMAKE_VARIABLES}")
3232

33-
set(BA_SOURCES
34-
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc.c
35-
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_linear.c
36-
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_global.c)
37-
3833
add_subdirectory(utils)
34+
add_subdirectory(base_alloc)
3935
add_subdirectory(coarse)
4036

41-
set(UMF_LIBS $<BUILD_INTERFACE:umf_utils> $<BUILD_INTERFACE:coarse>)
42-
43-
set(CTL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ctl/ctl.c)
44-
45-
if(LINUX)
46-
set(BA_SOURCES ${BA_SOURCES}
47-
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_linux.c)
48-
elseif(WINDOWS)
49-
set(BA_SOURCES ${BA_SOURCES}
50-
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_windows.c)
51-
elseif(MACOSX)
52-
set(BA_SOURCES ${BA_SOURCES}
53-
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_linux.c)
54-
endif()
55-
56-
set(BA_SOURCES
57-
${BA_SOURCES}
58-
PARENT_SCOPE)
37+
set(UMF_LIBS umf_utils umf_ba umf_coarse)
5938

6039
set(HWLOC_DEPENDENT_SOURCES topology.c)
6140

6241
set(UMF_SOURCES
63-
${BA_SOURCES}
64-
${CTL_SOURCES}
42+
ctl/ctl.c
6543
libumf.c
6644
ipc.c
6745
ipc_cache.c
@@ -178,7 +156,7 @@ target_include_directories(umf PRIVATE ${UMF_PRIVATE_INCLUDE_DIRS})
178156
target_link_directories(umf PRIVATE ${UMF_PRIVATE_LIBRARY_DIRS})
179157
target_compile_definitions(umf PRIVATE ${UMF_COMMON_COMPILE_DEFINITIONS})
180158

181-
add_dependencies(umf coarse)
159+
add_dependencies(umf umf_ba umf_coarse umf_utils)
182160

183161
if(UMF_LINK_HWLOC_STATICALLY)
184162
add_dependencies(umf ${UMF_HWLOC_NAME})
@@ -228,8 +206,6 @@ target_include_directories(
228206

229207
install(TARGETS umf EXPORT ${PROJECT_NAME}-targets)
230208

231-
add_subdirectory(pool)
232-
233209
if(UMF_PROXY_LIB_ENABLED)
234210
add_subdirectory(proxy_lib)
235211
endif()

src/base_alloc/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (C) 2025 Intel Corporation
2+
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake)
6+
7+
set(UMF_BA_SOURCES_COMMON base_alloc_global.c base_alloc.c base_alloc_linear.c)
8+
set(UMF_BA_SOURCES_LINUX base_alloc_linux.c)
9+
set(UMF_BA_SOURCES_WINDOWS base_alloc_windows.c)
10+
11+
if(LINUX OR MACOSX)
12+
set(UMF_BA_SOURCES ${UMF_BA_SOURCES_COMMON} ${UMF_BA_SOURCES_LINUX})
13+
elseif(WINDOWS)
14+
set(UMF_BA_SOURCES ${UMF_BA_SOURCES_COMMON} ${UMF_BA_SOURCES_WINDOWS})
15+
endif()
16+
17+
add_umf_library(
18+
NAME umf_ba
19+
TYPE STATIC
20+
SRCS ${UMF_BA_SOURCES}
21+
LIBS umf_utils)
22+
23+
target_include_directories(umf_ba
24+
PRIVATE ${UMF_CMAKE_SOURCE_DIR}/src/base_alloc)
25+
26+
if(NOT UMF_BUILD_SHARED_LIBRARY)
27+
install(TARGETS umf_ba EXPORT ${PROJECT_NAME}-targets)
28+
endif()

src/coarse/CMakeLists.txt

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,21 @@
44

55
include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake)
66

7-
set(COARSE_SOURCES coarse.c ../ravl/ravl.c)
8-
9-
if(UMF_BUILD_SHARED_LIBRARY AND (NOT WINDOWS))
10-
set(COARSE_EXTRA_SRCS ${BA_SOURCES})
11-
set(COARSE_EXTRA_LIBS $<BUILD_INTERFACE:umf_utils>)
12-
endif()
7+
set(UMF_COARSE_SOURCES coarse.c ${UMF_CMAKE_SOURCE_DIR}/src/ravl/ravl.c)
8+
set(UMF_COARSE_LIBS umf_utils umf_ba)
139

1410
add_umf_library(
15-
NAME coarse
11+
NAME umf_coarse
1612
TYPE STATIC
17-
SRCS ${COARSE_SOURCES} ${COARSE_EXTRA_SRCS}
18-
LIBS ${COARSE_EXTRA_LIBS})
13+
SRCS ${UMF_COARSE_SOURCES}
14+
LIBS ${UMF_COARSE_LIBS})
1915

2016
target_include_directories(
21-
coarse
22-
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
23-
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
24-
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/ravl>)
17+
umf_coarse
18+
PRIVATE ${UMF_CMAKE_SOURCE_DIR}/src/coarse
19+
${UMF_CMAKE_SOURCE_DIR}/src/base_alloc
20+
${UMF_CMAKE_SOURCE_DIR}/src/ravl)
2521

26-
add_library(${PROJECT_NAME}::coarse ALIAS coarse)
22+
if(NOT UMF_BUILD_SHARED_LIBRARY)
23+
install(TARGETS umf_coarse EXPORT ${PROJECT_NAME}-targets)
24+
endif()

src/pool/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)