Skip to content

Commit b9fc9e6

Browse files
Merge branch 'v0.10.x' into 'main'
2 parents bf8d0d8 + 286a6d8 commit b9fc9e6

15 files changed

+169
-54
lines changed

CMakeLists.txt

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ list(APPEND CMAKE_MODULE_PATH "${UMF_CMAKE_SOURCE_DIR}/cmake")
1111
include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake)
1212

1313
# We use semver aligned version, set via git tags. We parse git output to
14-
# establih the version of UMF to be used in CMake, Win dll's, and within the
14+
# establish the version of UMF to be used in CMake, Win dll's, and within the
1515
# code (e.g. in logger). We have 3-component releases (e.g. 1.5.1) plus release
1616
# candidates and git info. Function below sets all variables related to version.
1717
set_version_variables()
@@ -33,36 +33,47 @@ include(CMakePackageConfigHelpers)
3333
include(GNUInstallDirs)
3434
find_package(PkgConfig)
3535

36+
# Define a list to store the names of all options
37+
set(UMF_OPTIONS_LIST "")
38+
list(APPEND UMF_OPTIONS_LIST CMAKE_BUILD_TYPE)
39+
40+
# Define a macro to wrap the option() command and track the options
41+
macro(umf_option)
42+
list(APPEND UMF_OPTIONS_LIST ${ARGV0})
43+
option(${ARGV})
44+
endmacro()
45+
3646
# Build Options
37-
option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF)
38-
option(UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON)
39-
option(UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON)
40-
option(UMF_BUILD_LIBUMF_POOL_DISJOINT
41-
"Build the libumf_pool_disjoint static library" OFF)
42-
option(UMF_BUILD_LIBUMF_POOL_JEMALLOC
43-
"Build the libumf_pool_jemalloc static library" OFF)
44-
option(UMF_BUILD_TESTS "Build UMF tests" ON)
45-
option(UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF)
46-
option(UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF)
47-
option(UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF)
48-
option(UMF_BUILD_EXAMPLES "Build UMF examples" ON)
49-
option(UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF)
50-
option(UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF)
51-
option(UMF_DEVELOPER_MODE "Enable additional developer checks" OFF)
52-
option(
47+
umf_option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF)
48+
umf_option(UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON)
49+
umf_option(UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON)
50+
umf_option(UMF_BUILD_LIBUMF_POOL_DISJOINT
51+
"Build the libumf_pool_disjoint static library" OFF)
52+
umf_option(UMF_BUILD_LIBUMF_POOL_JEMALLOC
53+
"Build the libumf_pool_jemalloc static library" OFF)
54+
umf_option(UMF_BUILD_TESTS "Build UMF tests" ON)
55+
umf_option(UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF)
56+
umf_option(UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF)
57+
umf_option(UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF)
58+
umf_option(UMF_BUILD_EXAMPLES "Build UMF examples" ON)
59+
umf_option(UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF)
60+
umf_option(UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF)
61+
umf_option(UMF_DEVELOPER_MODE "Enable additional developer checks" OFF)
62+
umf_option(
5363
UMF_DISABLE_HWLOC
5464
"Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)"
5565
OFF)
56-
option(
66+
umf_option(
5767
UMF_LINK_HWLOC_STATICALLY
5868
"Link UMF with HWLOC library statically (proxy library will be disabled on Windows+Debug build)"
5969
OFF)
60-
option(UMF_FORMAT_CODE_STYLE
61-
"Add clang, cmake, and black -format-check and -format-apply targets"
62-
OFF)
70+
umf_option(
71+
UMF_FORMAT_CODE_STYLE
72+
"Add clang, cmake, and black -format-check and -format-apply targets" OFF)
6373
set(UMF_HWLOC_NAME
6474
"hwloc"
6575
CACHE STRING "Custom name for hwloc library w/o extension")
76+
list(APPEND UMF_OPTIONS_LIST UMF_HWLOC_NAME)
6677
set(UMF_INSTALL_RPATH
6778
""
6879
CACHE
@@ -71,13 +82,13 @@ set(UMF_INSTALL_RPATH
7182
)
7283

7384
# Only a part of skips is treated as a failure now. TODO: extend to all tests
74-
option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF)
75-
option(UMF_USE_ASAN "Enable AddressSanitizer checks" OFF)
76-
option(UMF_USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF)
77-
option(UMF_USE_TSAN "Enable ThreadSanitizer checks" OFF)
78-
option(UMF_USE_MSAN "Enable MemorySanitizer checks" OFF)
79-
option(UMF_USE_VALGRIND "Enable Valgrind instrumentation" OFF)
80-
option(UMF_USE_COVERAGE "Build with coverage enabled (Linux only)" OFF)
85+
umf_option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF)
86+
umf_option(UMF_USE_ASAN "Enable AddressSanitizer checks" OFF)
87+
umf_option(UMF_USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF)
88+
umf_option(UMF_USE_TSAN "Enable ThreadSanitizer checks" OFF)
89+
umf_option(UMF_USE_MSAN "Enable MemorySanitizer checks" OFF)
90+
umf_option(UMF_USE_VALGRIND "Enable Valgrind instrumentation" OFF)
91+
umf_option(UMF_USE_COVERAGE "Build with coverage enabled (Linux only)" OFF)
8192

8293
# set UMF_PROXY_LIB_BASED_ON_POOL to one of: SCALABLE or JEMALLOC
8394
set(KNOWN_PROXY_LIB_POOLS SCALABLE JEMALLOC)
@@ -87,6 +98,7 @@ set(UMF_PROXY_LIB_BASED_ON_POOL
8798
"A UMF pool the proxy library is based on (SCALABLE or JEMALLOC)")
8899
set_property(CACHE UMF_PROXY_LIB_BASED_ON_POOL
89100
PROPERTY STRINGS ${KNOWN_PROXY_LIB_POOLS})
101+
list(APPEND UMF_OPTIONS_LIST UMF_PROXY_LIB_BASED_ON_POOL)
90102

91103
if(UMF_BUILD_TESTS
92104
AND DEFINED ENV{CI}

CONTRIBUTING.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33

44
<!-- TODO: Add [Naming convention](#naming-convention) section -->
5-
- [Opening new issues](#opening-new-issues)
6-
- [Submitting Pull Requests](#submitting-pull-requests)
5+
- [Contributing to UMF (Unified Memory Framework)](#contributing-to-umf-unified-memory-framework)
6+
- [Opening new issues](#opening-new-issues)
7+
- [Submitting Pull Requests](#submitting-pull-requests)
78
- [Building and testing](#building-and-testing)
89
- [Code style](#code-style)
9-
- [When my PR is merged?](#when-my-PR-is-merged)
10+
- [When my PR is merged?](#when-my-pr-is-merged)
1011
- [Extending public API](#extending-public-api)
1112
- [License](#license)
1213
- [Adding new dependency](#adding-new-dependency)
13-
- [Code coverage](#code-coverage)
14+
- [Code coverage](#code-coverage)
15+
- [Debugging](#debugging)
16+
- [Checking the UMF version and CMake variables (Linux only)](#checking-the-umf-version-and-cmake-variables-linux-only)
17+
- [Requirements](#requirements)
1418

1519
Below you'll find instructions on how to contribute to UMF, either with code changes
1620
or issues. All contributions are most welcome!
@@ -222,3 +226,19 @@ $ apt install lcov
222226
$ lcov --capture --directory . --output-file coverage.info
223227
$ genhtml -o html_report coverage.info
224228
```
229+
230+
## Debugging
231+
232+
### Checking the UMF version and CMake variables (Linux only)
233+
234+
Strings with the UMF version and useful CMake variables can be grepped in the following way:
235+
236+
```bash
237+
$ strings libumf.so | grep "@(#)"
238+
@(#) Intel(R) UMF version: 0.11.0-dev.git66.g89e3831d
239+
@(#) Intel(R) UMF CMake variables: "CMAKE_BUILD_TYPE:Debug,...
240+
```
241+
242+
#### Requirements
243+
244+
- binutils package (Linux)

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
Fri Jan 10 2025 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
2+
3+
* Version 0.10.1
4+
5+
This patch release contains:
6+
- Set symbol versions 0.10 in def/map files (#1013)
7+
- Fix: remove incorrect assert in utils_align_ptr_up_size_down() (#977)
8+
- Add strings with UMF version and useful CMake options (#992)
9+
- Extended error messages, when providers are disabled (#1012)
10+
111
Mon Dec 09 2024 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
212

313
* Version 0.10.0

RELEASE_STEPS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ Do changes for a release:
3838
- If previously we decided not to create such branch, create it now, based on the appropriate minor or major tag
3939
- For major/minor release start from the `main` branch
4040
- Add an entry to ChangeLog, remember to change the day of the week in the release date
41-
- For major releases mention API and ABI compatibility with the previous release
41+
- For major and minor (prior 1.0.0) releases mention API and ABI compatibility with the previous release
4242
- For major and minor releases, update `UMF_VERSION_CURRENT` in `include/umf/base.h` (the API version)
43-
- For major releases update ABI version in `.map` and `.def` files
43+
- For major and minor (prior 1.0.0) releases update ABI version in `.map` and `.def` files
4444
- These files are defined for all public libraries (`libumf` and `proxy_lib`, at the moment)
4545
- Commit these changes and tag the release:
4646
- `git commit -a -S -m "$VERSION release"`

src/CMakeLists.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,24 @@ set(UMF_CUDA_INCLUDE_DIR
1111
""
1212
CACHE PATH "Directory containing the CUDA headers")
1313

14+
# Compose the UMF_ALL_CMAKE_VARIABLES variable containing CMake options that
15+
# will be saved in the constant string.
16+
list(SORT UMF_OPTIONS_LIST ORDER DESCENDING)
17+
foreach(_var ${UMF_OPTIONS_LIST})
18+
# Preprocessor definitions containing '#' cannot be passed on to the
19+
# compiler command line because many compilers do not support it.
20+
if(NOT "${${_var}}" MATCHES "#")
21+
set(UMF_ALL_CMAKE_VARIABLES
22+
"${_var}:${${_var}},${UMF_ALL_CMAKE_VARIABLES}")
23+
endif()
24+
endforeach()
25+
1426
# Compile definitions for UMF library.
1527
#
1628
# TODO: Cleanup the compile definitions across all the CMake files
17-
set(UMF_COMMON_COMPILE_DEFINITIONS ${UMF_COMMON_COMPILE_DEFINITIONS}
18-
UMF_VERSION=${UMF_VERSION})
29+
set(UMF_COMMON_COMPILE_DEFINITIONS
30+
${UMF_COMMON_COMPILE_DEFINITIONS} UMF_VERSION=${UMF_VERSION}
31+
UMF_ALL_CMAKE_VARIABLES="${UMF_ALL_CMAKE_VARIABLES}")
1932

2033
set(BA_SOURCES
2134
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc.c

src/libumf.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55
;;;; End Copyright Notice
66

7-
LIBRARY umf
7+
LIBRARY UMF
88

9-
VERSION 1.0
9+
VERSION 0.11
1010

1111
EXPORTS
1212
DllMain

src/libumf.map

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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-
UMF_1.0 {
5+
UMF_0.10 {
66
global:
77
umfInit;
88
umfTearDown;
@@ -25,9 +25,6 @@ UMF_1.0 {
2525
umfFileMemoryProviderParamsSetPath;
2626
umfFileMemoryProviderParamsSetProtection;
2727
umfFileMemoryProviderParamsSetVisibility;
28-
umfFixedMemoryProviderOps;
29-
umfFixedMemoryProviderParamsCreate;
30-
umfFixedMemoryProviderParamsDestroy;
3128
umfFree;
3229
umfGetIPCHandle;
3330
umfGetLastFailedMemoryProvider;
@@ -117,3 +114,9 @@ UMF_1.0 {
117114
local:
118115
*;
119116
};
117+
118+
UMF_0.11 {
119+
umfFixedMemoryProviderOps;
120+
umfFixedMemoryProviderParamsCreate;
121+
umfFixedMemoryProviderParamsDestroy;
122+
} UMF_0.10;

src/provider/provider_cuda.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,37 @@
1212
#include <umf.h>
1313
#include <umf/providers/provider_cuda.h>
1414

15+
#include "utils_log.h"
16+
1517
#if defined(UMF_NO_CUDA_PROVIDER)
1618

1719
umf_result_t umfCUDAMemoryProviderParamsCreate(
1820
umf_cuda_memory_provider_params_handle_t *hParams) {
1921
(void)hParams;
22+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
2023
return UMF_RESULT_ERROR_NOT_SUPPORTED;
2124
}
2225

2326
umf_result_t umfCUDAMemoryProviderParamsDestroy(
2427
umf_cuda_memory_provider_params_handle_t hParams) {
2528
(void)hParams;
29+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
2630
return UMF_RESULT_ERROR_NOT_SUPPORTED;
2731
}
2832

2933
umf_result_t umfCUDAMemoryProviderParamsSetContext(
3034
umf_cuda_memory_provider_params_handle_t hParams, void *hContext) {
3135
(void)hParams;
3236
(void)hContext;
37+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
3338
return UMF_RESULT_ERROR_NOT_SUPPORTED;
3439
}
3540

3641
umf_result_t umfCUDAMemoryProviderParamsSetDevice(
3742
umf_cuda_memory_provider_params_handle_t hParams, int hDevice) {
3843
(void)hParams;
3944
(void)hDevice;
45+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
4046
return UMF_RESULT_ERROR_NOT_SUPPORTED;
4147
}
4248

@@ -45,11 +51,13 @@ umf_result_t umfCUDAMemoryProviderParamsSetMemoryType(
4551
umf_usm_memory_type_t memoryType) {
4652
(void)hParams;
4753
(void)memoryType;
54+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
4855
return UMF_RESULT_ERROR_NOT_SUPPORTED;
4956
}
5057

5158
umf_memory_provider_ops_t *umfCUDAMemoryProviderOps(void) {
5259
// not supported
60+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
5361
return NULL;
5462
}
5563

src/provider/provider_devdax_memory.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
#include <umf/memory_provider_ops.h>
1818
#include <umf/providers/provider_devdax_memory.h>
1919

20+
#include "utils_log.h"
21+
2022
#if defined(_WIN32) || defined(UMF_NO_HWLOC)
2123

2224
umf_memory_provider_ops_t *umfDevDaxMemoryProviderOps(void) {
2325
// not supported
26+
LOG_ERR("DevDax memory provider is disabled!");
2427
return NULL;
2528
}
2629

@@ -30,12 +33,14 @@ umf_result_t umfDevDaxMemoryProviderParamsCreate(
3033
(void)hParams;
3134
(void)path;
3235
(void)size;
36+
LOG_ERR("DevDax memory provider is disabled!");
3337
return UMF_RESULT_ERROR_NOT_SUPPORTED;
3438
}
3539

3640
umf_result_t umfDevDaxMemoryProviderParamsDestroy(
3741
umf_devdax_memory_provider_params_handle_t hParams) {
3842
(void)hParams;
43+
LOG_ERR("DevDax memory provider is disabled!");
3944
return UMF_RESULT_ERROR_NOT_SUPPORTED;
4045
}
4146

@@ -45,13 +50,15 @@ umf_result_t umfDevDaxMemoryProviderParamsSetDeviceDax(
4550
(void)hParams;
4651
(void)path;
4752
(void)size;
53+
LOG_ERR("DevDax memory provider is disabled!");
4854
return UMF_RESULT_ERROR_NOT_SUPPORTED;
4955
}
5056

5157
umf_result_t umfDevDaxMemoryProviderParamsSetProtection(
5258
umf_devdax_memory_provider_params_handle_t hParams, unsigned protection) {
5359
(void)hParams;
5460
(void)protection;
61+
LOG_ERR("DevDax memory provider is disabled!");
5562
return UMF_RESULT_ERROR_NOT_SUPPORTED;
5663
}
5764

src/provider/provider_file_memory.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,44 @@
1818
#include <umf/memory_provider_ops.h>
1919
#include <umf/providers/provider_file_memory.h>
2020

21+
#include "utils_log.h"
22+
2123
#if defined(_WIN32) || defined(UMF_NO_HWLOC)
2224

2325
umf_memory_provider_ops_t *umfFileMemoryProviderOps(void) {
2426
// not supported
27+
LOG_ERR("File memory provider is disabled!");
2528
return NULL;
2629
}
2730

2831
umf_result_t umfFileMemoryProviderParamsCreate(
2932
umf_file_memory_provider_params_handle_t *hParams, const char *path) {
3033
(void)hParams;
3134
(void)path;
35+
LOG_ERR("File memory provider is disabled!");
3236
return UMF_RESULT_ERROR_NOT_SUPPORTED;
3337
}
3438

3539
umf_result_t umfFileMemoryProviderParamsDestroy(
3640
umf_file_memory_provider_params_handle_t hParams) {
3741
(void)hParams;
42+
LOG_ERR("File memory provider is disabled!");
3843
return UMF_RESULT_ERROR_NOT_SUPPORTED;
3944
}
4045

4146
umf_result_t umfFileMemoryProviderParamsSetPath(
4247
umf_file_memory_provider_params_handle_t hParams, const char *path) {
4348
(void)hParams;
4449
(void)path;
50+
LOG_ERR("File memory provider is disabled!");
4551
return UMF_RESULT_ERROR_NOT_SUPPORTED;
4652
}
4753

4854
umf_result_t umfFileMemoryProviderParamsSetProtection(
4955
umf_file_memory_provider_params_handle_t hParams, unsigned protection) {
5056
(void)hParams;
5157
(void)protection;
58+
LOG_ERR("File memory provider is disabled!");
5259
return UMF_RESULT_ERROR_NOT_SUPPORTED;
5360
}
5461

@@ -57,6 +64,7 @@ umf_result_t umfFileMemoryProviderParamsSetVisibility(
5764
umf_memory_visibility_t visibility) {
5865
(void)hParams;
5966
(void)visibility;
67+
LOG_ERR("File memory provider is disabled!");
6068
return UMF_RESULT_ERROR_NOT_SUPPORTED;
6169
}
6270

0 commit comments

Comments
 (0)