From 4ff474fdcaf82bc462942d8681884450e3c8d389 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Fri, 6 Dec 2024 17:11:14 +0100 Subject: [PATCH 1/9] Fix: remove incorrect assert in utils_align_ptr_up_size_down() Remove incorrect assert in utils_align_ptr_up_size_down(). A pointer is aligned, but a size is only adjusted to the new pointer. The size does not have to be aligned. Signed-off-by: Lukasz Dorau --- src/utils/utils_common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/utils_common.c b/src/utils/utils_common.c index bffc9f355..eaf5420fc 100644 --- a/src/utils/utils_common.c +++ b/src/utils/utils_common.c @@ -25,7 +25,6 @@ void utils_align_ptr_up_size_down(void **ptr, size_t *size, size_t alignment) { } ASSERT(IS_ALIGNED(p, alignment)); - ASSERT(IS_ALIGNED(s, alignment)); *ptr = (void *)p; *size = s; From dd47ffc2b8ec3eeb68ff4bf6789710aee50e76fe Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Mon, 9 Dec 2024 15:53:02 +0100 Subject: [PATCH 2/9] Add tests for utils_align_ptr_up_size_down() Signed-off-by: Lukasz Dorau --- test/utils/utils_linux.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/utils/utils_linux.cpp b/test/utils/utils_linux.cpp index 7aa0a9d83..1815a1a78 100644 --- a/test/utils/utils_linux.cpp +++ b/test/utils/utils_linux.cpp @@ -2,6 +2,7 @@ // Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include #include #include "base.hpp" @@ -169,3 +170,19 @@ TEST_F(test, utils_open) { EXPECT_EQ(utils_file_open(NULL), -1); EXPECT_EQ(utils_file_open_or_create(NULL), -1); } + +TEST_F(test, utils_align_ptr_up_size_down) { + uintptr_t ptr = 0x4000; + size_t size = 0x8000; + size_t alignment = 0x4000; + utils_align_ptr_up_size_down((void **)&ptr, &size, alignment); + EXPECT_EQ(ptr, 0x4000); + EXPECT_EQ(size, 0x8000); + + ptr = 0x4001; + size = 0x8000; + alignment = 0x4000; + utils_align_ptr_up_size_down((void **)&ptr, &size, alignment); + EXPECT_EQ(ptr, 0x8000); + EXPECT_EQ(size, 0x4001); +} From 0f8b59dcbbb9b52370f40978c20c62d19331c1f0 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Thu, 12 Dec 2024 14:00:40 +0100 Subject: [PATCH 3/9] Add strings with UMF version and useful CMake options Add strings with UMF version and useful CMake options that can be grepped in the following way: $ strings libumf.so | grep "@(#)" @(#) Intel(R) UMF version: 0.11.0-dev.git66.g89e3831d @(#) Intel(R) UMF CMake variables: "CMAKE_BUILD_TYPE:Debug,... Signed-off-by: Lukasz Dorau --- CMakeLists.txt | 66 ++++++++++++++++++++++++---------------- CONTRIBUTING.md | 28 ++++++++++++++--- src/CMakeLists.txt | 16 +++++++++- src/utils/utils_log.c | 34 +++++++++++++++------ test/utils/utils_log.cpp | 3 ++ 5 files changed, 105 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5614684bd..f71ce1820 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,36 +33,47 @@ include(CMakePackageConfigHelpers) include(GNUInstallDirs) find_package(PkgConfig) +# Define a list to store the names of all options +set(UMF_OPTIONS_LIST "") +list(APPEND UMF_OPTIONS_LIST CMAKE_BUILD_TYPE) + +# Define a macro to wrap the option() command and track the options +macro(umf_option) + list(APPEND UMF_OPTIONS_LIST ${ARGV0}) + option(${ARGV}) +endmacro() + # Build Options -option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF) -option(UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON) -option(UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON) -option(UMF_BUILD_LIBUMF_POOL_DISJOINT - "Build the libumf_pool_disjoint static library" OFF) -option(UMF_BUILD_LIBUMF_POOL_JEMALLOC - "Build the libumf_pool_jemalloc static library" OFF) -option(UMF_BUILD_TESTS "Build UMF tests" ON) -option(UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF) -option(UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF) -option(UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF) -option(UMF_BUILD_EXAMPLES "Build UMF examples" ON) -option(UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF) -option(UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF) -option(UMF_DEVELOPER_MODE "Enable additional developer checks" OFF) -option( +umf_option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF) +umf_option(UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON) +umf_option(UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON) +umf_option(UMF_BUILD_LIBUMF_POOL_DISJOINT + "Build the libumf_pool_disjoint static library" OFF) +umf_option(UMF_BUILD_LIBUMF_POOL_JEMALLOC + "Build the libumf_pool_jemalloc static library" OFF) +umf_option(UMF_BUILD_TESTS "Build UMF tests" ON) +umf_option(UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF) +umf_option(UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF) +umf_option(UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF) +umf_option(UMF_BUILD_EXAMPLES "Build UMF examples" ON) +umf_option(UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF) +umf_option(UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF) +umf_option(UMF_DEVELOPER_MODE "Enable additional developer checks" OFF) +umf_option( UMF_DISABLE_HWLOC "Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)" OFF) -option( +umf_option( UMF_LINK_HWLOC_STATICALLY "Link UMF with HWLOC library statically (supported for Linux, MacOS and Release build on Windows)" OFF) -option(UMF_FORMAT_CODE_STYLE - "Add clang, cmake, and black -format-check and -format-apply targets" - OFF) +umf_option( + UMF_FORMAT_CODE_STYLE + "Add clang, cmake, and black -format-check and -format-apply targets" OFF) set(UMF_HWLOC_NAME "hwloc" CACHE STRING "Custom name for hwloc library w/o extension") +list(APPEND UMF_OPTIONS_LIST UMF_HWLOC_NAME) set(UMF_INSTALL_RPATH "" CACHE @@ -71,13 +82,13 @@ set(UMF_INSTALL_RPATH ) # Only a part of skips is treated as a failure now. TODO: extend to all tests -option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF) -option(UMF_USE_ASAN "Enable AddressSanitizer checks" OFF) -option(UMF_USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF) -option(UMF_USE_TSAN "Enable ThreadSanitizer checks" OFF) -option(UMF_USE_MSAN "Enable MemorySanitizer checks" OFF) -option(UMF_USE_VALGRIND "Enable Valgrind instrumentation" OFF) -option(UMF_USE_COVERAGE "Build with coverage enabled (Linux only)" OFF) +umf_option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF) +umf_option(UMF_USE_ASAN "Enable AddressSanitizer checks" OFF) +umf_option(UMF_USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF) +umf_option(UMF_USE_TSAN "Enable ThreadSanitizer checks" OFF) +umf_option(UMF_USE_MSAN "Enable MemorySanitizer checks" OFF) +umf_option(UMF_USE_VALGRIND "Enable Valgrind instrumentation" OFF) +umf_option(UMF_USE_COVERAGE "Build with coverage enabled (Linux only)" OFF) # set UMF_PROXY_LIB_BASED_ON_POOL to one of: SCALABLE or JEMALLOC set(KNOWN_PROXY_LIB_POOLS SCALABLE JEMALLOC) @@ -87,6 +98,7 @@ set(UMF_PROXY_LIB_BASED_ON_POOL "A UMF pool the proxy library is based on (SCALABLE or JEMALLOC)") set_property(CACHE UMF_PROXY_LIB_BASED_ON_POOL PROPERTY STRINGS ${KNOWN_PROXY_LIB_POOLS}) +list(APPEND UMF_OPTIONS_LIST UMF_PROXY_LIB_BASED_ON_POOL) if(UMF_BUILD_TESTS AND DEFINED ENV{CI} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd4a2a790..7b9749c49 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,15 +2,19 @@ -- [Opening new issues](#opening-new-issues) -- [Submitting Pull Requests](#submitting-pull-requests) +- [Contributing to UMF (Unified Memory Framework)](#contributing-to-umf-unified-memory-framework) + - [Opening new issues](#opening-new-issues) + - [Submitting Pull Requests](#submitting-pull-requests) - [Building and testing](#building-and-testing) - [Code style](#code-style) - - [When my PR is merged?](#when-my-PR-is-merged) + - [When my PR is merged?](#when-my-pr-is-merged) - [Extending public API](#extending-public-api) - [License](#license) - [Adding new dependency](#adding-new-dependency) -- [Code coverage](#code-coverage) + - [Code coverage](#code-coverage) + - [Debugging](#debugging) + - [Checking the UMF version and CMake variables (Linux only)](#checking-the-umf-version-and-cmake-variables-linux-only) + - [Requirements](#requirements) Below you'll find instructions on how to contribute to UMF, either with code changes or issues. All contributions are most welcome! @@ -222,3 +226,19 @@ $ apt install lcov $ lcov --capture --directory . --output-file coverage.info $ genhtml -o html_report coverage.info ``` + +## Debugging + +### Checking the UMF version and CMake variables (Linux only) + +Strings with the UMF version and useful CMake variables can be grepped in the following way: + +```bash +$ strings libumf.so | grep "@(#)" +@(#) Intel(R) UMF version: 0.11.0-dev.git66.g89e3831d +@(#) Intel(R) UMF CMake variables: "CMAKE_BUILD_TYPE:Debug,... +``` + +#### Requirements + +- binutils package (Linux) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b4736ed0f..57050e827 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,10 +11,24 @@ set(UMF_CUDA_INCLUDE_DIR "" CACHE PATH "Directory containing the CUDA headers") +# Compose the UMF_ALL_CMAKE_VARIABLES variable containing CMake options that +# will be saved in the constant string. +list(SORT UMF_OPTIONS_LIST ORDER DESCENDING) +foreach(_var ${UMF_OPTIONS_LIST}) + # Preprocessor definitions containing '#' cannot be passed on to the + # compiler command line because many compilers do not support it. + if(NOT "${${_var}}" MATCHES "#") + set(UMF_ALL_CMAKE_VARIABLES + "${_var}:${${_var}},${UMF_ALL_CMAKE_VARIABLES}") + endif() +endforeach() + # Compile definitions for UMF library. # # TODO: Cleanup the compile definitions across all the CMake files -set(UMF_COMMON_COMPILE_DEFINITIONS UMF_VERSION=${UMF_VERSION}) +set(UMF_COMMON_COMPILE_DEFINITIONS + UMF_VERSION=${UMF_VERSION} + UMF_ALL_CMAKE_VARIABLES="${UMF_ALL_CMAKE_VARIABLES}") add_subdirectory(utils) diff --git a/src/utils/utils_log.c b/src/utils/utils_log.c index bdb9ce823..2fd28fc2c 100644 --- a/src/utils/utils_log.c +++ b/src/utils/utils_log.c @@ -32,6 +32,29 @@ #include "utils_common.h" #include "utils_log.h" +#define UMF_MAGIC_STR "\x00@(#) " +#define UMF_PREF_STR "Intel(R) " +#define UMF_PREFIX UMF_MAGIC_STR UMF_PREF_STR + +// convert a define to a C string +#define STR_(X) #X +#define STR(X) STR_(X) + +#ifdef UMF_VERSION +#define STR_UMF_VERSION "UMF version: " STR(UMF_VERSION) +#define LOG_STR_UMF_VERSION STR_UMF_VERSION ", " +char const __umf_str_2_version[] = UMF_PREFIX STR_UMF_VERSION; +#else /* !UMF_VERSION */ +#error "UMF_VERSION not defined!" +#endif /* !UMF_VERSION */ + +#ifdef UMF_ALL_CMAKE_VARIABLES +char const __umf_str_1__all_cmake_vars[] = + UMF_PREFIX "UMF CMake variables: " STR(UMF_ALL_CMAKE_VARIABLES); +#else /* !UMF_ALL_CMAKE_VARIABLES */ +#error "UMF_ALL_CMAKE_VARIABLES not defined!" +#endif /* !UMF_ALL_CMAKE_VARIABLES */ + #define LOG_MAX 8192 #define LOG_HEADER 256 #define MAX_FILE_PATH 256 @@ -305,17 +328,8 @@ void utils_log_init(void) { loggerConfig.flushLevel = LOG_FATAL; } -#ifdef UMF_VERSION -// convert a define to a C string -#define STR_(X) #X -#define STR(X) STR_(X) -#define STR_UMF_VERSION "UMF version: " STR(UMF_VERSION) ", " -#else /* !UMF_VERSION */ -#error "UMF_VERSION not defined!" -#endif /* !UMF_VERSION */ - LOG_INFO( - "Logger enabled (" STR_UMF_VERSION + "Logger enabled (" LOG_STR_UMF_VERSION "level: %s, flush: %s, pid: %s, timestamp: %s)", level_to_str(loggerConfig.level), level_to_str(loggerConfig.flushLevel), bool_to_str(loggerConfig.pid), bool_to_str(loggerConfig.timestamp)); diff --git a/test/utils/utils_log.cpp b/test/utils/utils_log.cpp index c0f81abf0..cce61db58 100644 --- a/test/utils/utils_log.cpp +++ b/test/utils/utils_log.cpp @@ -110,6 +110,9 @@ const char *env_variable = ""; #ifndef UMF_VERSION #define UMF_VERSION "test version" #endif +#ifndef UMF_ALL_CMAKE_VARIABLES +#define UMF_ALL_CMAKE_VARIABLES "test UMF_ALL_CMAKE_VARIABLES" +#endif #include "utils/utils_log.c" #undef utils_env_var #undef fopen From b09b24330b21e92de8dcee3d2cb90d1f8884e864 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Fri, 20 Dec 2024 09:31:51 +0100 Subject: [PATCH 4/9] Add error messages when CUDA provider is disabled Add error messages when CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF). Signed-off-by: Lukasz Dorau --- src/provider/provider_cuda.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/provider/provider_cuda.c b/src/provider/provider_cuda.c index baccbd023..ce2f1debb 100644 --- a/src/provider/provider_cuda.c +++ b/src/provider/provider_cuda.c @@ -12,17 +12,21 @@ #include #include +#include "utils_log.h" + #if defined(UMF_NO_CUDA_PROVIDER) umf_result_t umfCUDAMemoryProviderParamsCreate( umf_cuda_memory_provider_params_handle_t *hParams) { (void)hParams; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_result_t umfCUDAMemoryProviderParamsDestroy( umf_cuda_memory_provider_params_handle_t hParams) { (void)hParams; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -30,6 +34,7 @@ umf_result_t umfCUDAMemoryProviderParamsSetContext( umf_cuda_memory_provider_params_handle_t hParams, void *hContext) { (void)hParams; (void)hContext; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -37,6 +42,7 @@ umf_result_t umfCUDAMemoryProviderParamsSetDevice( umf_cuda_memory_provider_params_handle_t hParams, int hDevice) { (void)hParams; (void)hDevice; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -45,11 +51,13 @@ umf_result_t umfCUDAMemoryProviderParamsSetMemoryType( umf_usm_memory_type_t memoryType) { (void)hParams; (void)memoryType; + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_memory_provider_ops_t *umfCUDAMemoryProviderOps(void) { // not supported + LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!"); return NULL; } From b108d7fc3767a5446bdaa19458e56188310df5eb Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Fri, 20 Dec 2024 09:32:14 +0100 Subject: [PATCH 5/9] Add error messages when DevDax provider is disabled Signed-off-by: Lukasz Dorau --- src/provider/provider_devdax_memory.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/provider/provider_devdax_memory.c b/src/provider/provider_devdax_memory.c index 32407acbb..cb5a4af57 100644 --- a/src/provider/provider_devdax_memory.c +++ b/src/provider/provider_devdax_memory.c @@ -17,10 +17,13 @@ #include #include +#include "utils_log.h" + #if defined(_WIN32) || defined(UMF_NO_HWLOC) umf_memory_provider_ops_t *umfDevDaxMemoryProviderOps(void) { // not supported + LOG_ERR("DevDax memory provider is disabled!"); return NULL; } @@ -30,12 +33,14 @@ umf_result_t umfDevDaxMemoryProviderParamsCreate( (void)hParams; (void)path; (void)size; + LOG_ERR("DevDax memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_result_t umfDevDaxMemoryProviderParamsDestroy( umf_devdax_memory_provider_params_handle_t hParams) { (void)hParams; + LOG_ERR("DevDax memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -45,6 +50,7 @@ umf_result_t umfDevDaxMemoryProviderParamsSetDeviceDax( (void)hParams; (void)path; (void)size; + LOG_ERR("DevDax memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -52,6 +58,7 @@ umf_result_t umfDevDaxMemoryProviderParamsSetProtection( umf_devdax_memory_provider_params_handle_t hParams, unsigned protection) { (void)hParams; (void)protection; + LOG_ERR("DevDax memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } From 3d9f85f98972035d5c4cedfb9e7a93a05ecc2009 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Fri, 20 Dec 2024 09:34:05 +0100 Subject: [PATCH 6/9] Add error messages when File provider is disabled Signed-off-by: Lukasz Dorau --- src/provider/provider_file_memory.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/provider/provider_file_memory.c b/src/provider/provider_file_memory.c index 32383a5ec..7c9ee3856 100644 --- a/src/provider/provider_file_memory.c +++ b/src/provider/provider_file_memory.c @@ -18,10 +18,13 @@ #include #include +#include "utils_log.h" + #if defined(_WIN32) || defined(UMF_NO_HWLOC) umf_memory_provider_ops_t *umfFileMemoryProviderOps(void) { // not supported + LOG_ERR("File memory provider is disabled!"); return NULL; } @@ -29,12 +32,14 @@ umf_result_t umfFileMemoryProviderParamsCreate( umf_file_memory_provider_params_handle_t *hParams, const char *path) { (void)hParams; (void)path; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_result_t umfFileMemoryProviderParamsDestroy( umf_file_memory_provider_params_handle_t hParams) { (void)hParams; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -42,6 +47,7 @@ umf_result_t umfFileMemoryProviderParamsSetPath( umf_file_memory_provider_params_handle_t hParams, const char *path) { (void)hParams; (void)path; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -49,6 +55,7 @@ umf_result_t umfFileMemoryProviderParamsSetProtection( umf_file_memory_provider_params_handle_t hParams, unsigned protection) { (void)hParams; (void)protection; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -57,6 +64,7 @@ umf_result_t umfFileMemoryProviderParamsSetVisibility( umf_memory_visibility_t visibility) { (void)hParams; (void)visibility; + LOG_ERR("File memory provider is disabled!"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } From 0d0d9b2f314e1cb07e11a9efe6d651134b34d6aa Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Fri, 20 Dec 2024 10:43:03 +0100 Subject: [PATCH 7/9] Add error messages when L0 memory provider is disabled Add error messages when L0 memory provider is disabled (UMF_BUILD_LEVEL_ZERO_PROVIDER is OFF). Signed-off-by: Lukasz Dorau --- src/provider/provider_level_zero.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/provider/provider_level_zero.c b/src/provider/provider_level_zero.c index f4a3e97c2..5f9c85a86 100644 --- a/src/provider/provider_level_zero.c +++ b/src/provider/provider_level_zero.c @@ -14,17 +14,23 @@ #include #include +#include "utils_log.h" + #if defined(UMF_NO_LEVEL_ZERO_PROVIDER) umf_result_t umfLevelZeroMemoryProviderParamsCreate( umf_level_zero_memory_provider_params_handle_t *hParams) { (void)hParams; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_result_t umfLevelZeroMemoryProviderParamsDestroy( umf_level_zero_memory_provider_params_handle_t hParams) { (void)hParams; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -33,6 +39,8 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetContext( ze_context_handle_t hContext) { (void)hParams; (void)hContext; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -41,6 +49,8 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetDevice( ze_device_handle_t hDevice) { (void)hParams; (void)hDevice; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -49,6 +59,8 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetMemoryType( umf_usm_memory_type_t memoryType) { (void)hParams; (void)memoryType; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } @@ -58,11 +70,15 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetResidentDevices( (void)hParams; (void)hDevices; (void)deviceCount; + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return UMF_RESULT_ERROR_NOT_SUPPORTED; } umf_memory_provider_ops_t *umfLevelZeroMemoryProviderOps(void) { // not supported + LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is " + "OFF)"); return NULL; } From c0331a480bb65138aff23dcced14e3ca5de1855a Mon Sep 17 00:00:00 2001 From: Rafal Rudnicki Date: Fri, 6 Dec 2024 10:21:34 +0100 Subject: [PATCH 8/9] Set symbol versions in def/map files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Łukasz Stolarczuk --- RELEASE_STEPS.md | 4 ++-- src/libumf.def | 4 ++-- src/libumf.map | 2 +- src/proxy_lib/proxy_lib.def | 1 + src/proxy_lib/proxy_lib.map | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/RELEASE_STEPS.md b/RELEASE_STEPS.md index e88ca9c2d..ec6e5b690 100644 --- a/RELEASE_STEPS.md +++ b/RELEASE_STEPS.md @@ -38,12 +38,12 @@ Do changes for a release: - If previously we decided not to create such branch, create it now, based on the appropriate minor or major tag - For major/minor release start from the `main` branch - Add an entry to ChangeLog, remember to change the day of the week in the release date - - For major releases mention API and ABI compatibility with the previous release + - For major and minor (prior 1.0.0) releases mention API and ABI compatibility with the previous release - Update project's version in a few places: - For major and minor releases: `UMF_VERSION_CURRENT` in `include/umf/base.h` (the API version) - `release` variable in `scripts/docs_config/conf.py` (for docs) - `UMF_VERSION` variable in `.github/workflows/basic.yml` (for installation test) -- For major releases update ABI version in `.map` and `.def` files +- For major and minor (prior 1.0.0) releases update ABI version in `.map` and `.def` files - These files are defined for all public libraries (`libumf` and `proxy_lib`, at the moment) - Commit these changes and tag the release: - `git commit -a -S -m "$VERSION release"` diff --git a/src/libumf.def b/src/libumf.def index 33c09f4b9..82e32d4a1 100644 --- a/src/libumf.def +++ b/src/libumf.def @@ -4,9 +4,9 @@ ; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ;;;; End Copyright Notice -LIBRARY umf +LIBRARY UMF -VERSION 1.0 +VERSION 0.10 EXPORTS DllMain diff --git a/src/libumf.map b/src/libumf.map index c1e1fd62c..4755b6b81 100644 --- a/src/libumf.map +++ b/src/libumf.map @@ -2,7 +2,7 @@ # Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -UMF_1.0 { +UMF_0.10 { global: umfInit; umfTearDown; diff --git a/src/proxy_lib/proxy_lib.def b/src/proxy_lib/proxy_lib.def index f30b40556..82b666b6a 100644 --- a/src/proxy_lib/proxy_lib.def +++ b/src/proxy_lib/proxy_lib.def @@ -5,6 +5,7 @@ ;;;; End Copyright Notice LIBRARY UMF_PROXY + EXPORTS DllMain aligned_alloc diff --git a/src/proxy_lib/proxy_lib.map b/src/proxy_lib/proxy_lib.map index 5d93d03ba..93ae001e6 100644 --- a/src/proxy_lib/proxy_lib.map +++ b/src/proxy_lib/proxy_lib.map @@ -2,8 +2,8 @@ # Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# linker VERSION script - +# These functions are meant to be in unnamed scope. They are also not named +# with any umf prefix, as they should override functions with the same name. { global: aligned_alloc; From 286a6d8507fab37fb799c341dfa19db0561f4a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Stolarczuk?= Date: Fri, 10 Jan 2025 13:30:49 +0100 Subject: [PATCH 9/9] 0.10.1 release --- .github/workflows/reusable_basic.yml | 2 +- ChangeLog | 10 ++++++++++ scripts/docs_config/conf.py | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable_basic.yml b/.github/workflows/reusable_basic.yml index 1c13a771b..ced48e0c7 100644 --- a/.github/workflows/reusable_basic.yml +++ b/.github/workflows/reusable_basic.yml @@ -8,7 +8,7 @@ permissions: env: # for installation testing - it should match with version set in CMake - UMF_VERSION: 0.10.0 + UMF_VERSION: 0.10.1 BUILD_DIR : "${{github.workspace}}/build" INSTL_DIR : "${{github.workspace}}/../install-dir" COVERAGE_DIR : "${{github.workspace}}/coverage" diff --git a/ChangeLog b/ChangeLog index 75b69fdeb..0736379f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Fri Jan 10 2025 Łukasz Stolarczuk + + * Version 0.10.1 + + This patch release contains: + - Set symbol versions 0.10 in def/map files (#1013) + - Fix: remove incorrect assert in utils_align_ptr_up_size_down() (#977) + - Add strings with UMF version and useful CMake options (#992) + - Extended error messages, when providers are disabled (#1012) + Mon Dec 09 2024 Łukasz Stolarczuk * Version 0.10.0 diff --git a/scripts/docs_config/conf.py b/scripts/docs_config/conf.py index 28c9b5f9f..77d985627 100644 --- a/scripts/docs_config/conf.py +++ b/scripts/docs_config/conf.py @@ -18,11 +18,11 @@ # -- Project information ----------------------------------------------------- project = "Intel Unified Memory Framework" -copyright = "2023-2024, Intel" +copyright = "2023-2025, Intel" author = "Intel" # The full version, including alpha/beta/rc tags -release = "0.10.0" +release = "0.10.1" # -- General configuration --------------------------------------------------- pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy