Skip to content

Commit bf8dea7

Browse files
committed
todo
1 parent e31c856 commit bf8dea7

33 files changed

+486
-120
lines changed

.github/workflows/pr_push.yml

Lines changed: 7 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -16,75 +16,11 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
CodeChecks:
20-
uses: ./.github/workflows/reusable_checks.yml
21-
DocsBuild:
22-
uses: ./.github/workflows/reusable_docs_build.yml
23-
FastBuild:
24-
name: Fast builds
25-
needs: [CodeChecks, DocsBuild]
26-
uses: ./.github/workflows/reusable_fast.yml
27-
Build:
28-
name: Basic builds
29-
needs: [FastBuild]
30-
uses: ./.github/workflows/reusable_basic.yml
31-
DevDax:
32-
needs: [FastBuild]
33-
uses: ./.github/workflows/reusable_dax.yml
34-
MultiNuma:
35-
needs: [FastBuild]
36-
uses: ./.github/workflows/reusable_multi_numa.yml
37-
L0:
38-
needs: [Build]
39-
uses: ./.github/workflows/reusable_gpu.yml
19+
Compatibility:
20+
name: Compatibility
21+
uses: ./.github/workflows/reusable_compatibility.yml
22+
strategy:
23+
matrix:
24+
tag: ["v0.10.1"]
4025
with:
41-
name: "LEVEL_ZERO"
42-
shared_lib: "['ON']"
43-
CUDA:
44-
needs: [Build]
45-
uses: ./.github/workflows/reusable_gpu.yml
46-
with:
47-
name: "CUDA"
48-
shared_lib: "['ON']"
49-
Sanitizers:
50-
needs: [FastBuild]
51-
uses: ./.github/workflows/reusable_sanitizers.yml
52-
QEMU:
53-
needs: [FastBuild]
54-
uses: ./.github/workflows/reusable_qemu.yml
55-
with:
56-
short_run: true
57-
Benchmarks:
58-
needs: [Build]
59-
uses: ./.github/workflows/reusable_benchmarks.yml
60-
ProxyLib:
61-
needs: [Build]
62-
uses: ./.github/workflows/reusable_proxy_lib.yml
63-
Valgrind:
64-
needs: [Build]
65-
uses: ./.github/workflows/reusable_valgrind.yml
66-
Coverage:
67-
# total coverage (on upstream only)
68-
if: github.repository == 'oneapi-src/unified-memory-framework'
69-
needs: [Build, DevDax, L0, CUDA, MultiNuma, QEMU, ProxyLib]
70-
uses: ./.github/workflows/reusable_coverage.yml
71-
secrets: inherit
72-
with:
73-
trigger: "${{github.event_name}}"
74-
Coverage_partial:
75-
# partial coverage (on forks)
76-
if: github.repository != 'oneapi-src/unified-memory-framework'
77-
needs: [Build, QEMU, ProxyLib]
78-
uses: ./.github/workflows/reusable_coverage.yml
79-
CodeQL:
80-
needs: [Build]
81-
permissions:
82-
contents: read
83-
security-events: write
84-
uses: ./.github/workflows/reusable_codeql.yml
85-
Trivy:
86-
needs: [Build]
87-
permissions:
88-
contents: read
89-
security-events: write
90-
uses: ./.github/workflows/reusable_trivy.yml
26+
tag: ${{ matrix.tag }}
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# TODO
2+
name: Compatibility
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
tag:
8+
description: Check backward compatibility with this tag
9+
type: string
10+
default: "0.10.1"
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
ubuntu-build:
17+
name: Ubuntu
18+
strategy:
19+
matrix:
20+
# TODO other systems?
21+
os: ['ubuntu-22.04']
22+
build_type: [Debug]
23+
compiler: [{c: gcc, cxx: g++}]
24+
shared_library: ['ON']
25+
level_zero_provider: ['ON']
26+
cuda_provider: ['ON']
27+
install_tbb: ['ON']
28+
runs-on: ${{matrix.os}}
29+
30+
steps:
31+
# NOTE: we need jemalloc for older version of UMF
32+
- name: Install apt packages
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y clang cmake libnuma-dev libjemalloc-dev
36+
37+
- name: Install TBB apt package
38+
if: matrix.install_tbb == 'ON'
39+
run: |
40+
sudo apt-get install -y libtbb-dev
41+
42+
- name: Checkout "tag" UMF version
43+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
44+
with:
45+
fetch-depth: 0
46+
ref: refs/tags/${{inputs.tag}}
47+
path: ${{github.workspace}}/tag_version
48+
49+
- name: Install libhwloc
50+
working-directory: ${{github.workspace}}/tag_version
51+
run: .github/scripts/install_hwloc.sh
52+
53+
- name: Get "tag" UMF version
54+
working-directory: ${{github.workspace}}/tag_version
55+
run: |
56+
VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+')
57+
echo "tag version: $VERSION"
58+
59+
- name: Configure "tag" UMF build
60+
working-directory: ${{github.workspace}}/tag_version
61+
run: >
62+
cmake
63+
-B ${{github.workspace}}/tag_version/build
64+
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/tag_version/build/install"
65+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
66+
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
67+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
68+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
69+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
70+
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}}
71+
-DUMF_FORMAT_CODE_STYLE=OFF
72+
-DUMF_DEVELOPER_MODE=ON
73+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
74+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
75+
-DUMF_TESTS_FAIL_ON_SKIP=ON
76+
77+
- name: Build "tag" UMF
78+
working-directory: ${{github.workspace}}/tag_version
79+
run: |
80+
cmake --build ${{github.workspace}}/tag_version/build -j $(nproc)
81+
82+
# NOTE: we need jemalloc for older version of UMF
83+
# if: startsWith(github.event.inputs.tag, '0.10.') || startsWith(github.event.inputs.tag, '0.9.')
84+
- name: Set ptrace value for IPC test
85+
run: sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"
86+
87+
- name: Run "tag" UMF tests
88+
working-directory: ${{github.workspace}}/tag_version/build
89+
run: |
90+
LD_LIBRARY_PATH=${{github.workspace}}/tag_version/build/lib/ ctest --output-on-failure
91+
92+
- name: Checkout latest UMF version
93+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
94+
with:
95+
fetch-depth: 0
96+
path: ${{github.workspace}}/latest_version
97+
98+
- name: Get latest UMF version
99+
working-directory: ${{github.workspace}}/latest_version
100+
run: |
101+
VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+')
102+
echo "checked version: $VERSION"
103+
104+
- name: Configure latest UMF build
105+
working-directory: ${{github.workspace}}/latest_version
106+
run: >
107+
cmake
108+
-B ${{github.workspace}}/latest_version/build
109+
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/latest_version/build/install"
110+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
111+
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
112+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
113+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
114+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
115+
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}}
116+
-DUMF_FORMAT_CODE_STYLE=OFF
117+
-DUMF_DEVELOPER_MODE=ON
118+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
119+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
120+
-DUMF_TESTS_FAIL_ON_SKIP=ON
121+
122+
- name: Build latest UMF
123+
working-directory: ${{github.workspace}}/latest_version
124+
run: |
125+
cmake --build ${{github.workspace}}/latest_version/build -j $(nproc)
126+
127+
# NOTE: exclude umf-provider_coarse, umf-disjointCoarseMallocPool,
128+
# umf-jemalloc_coarse_file, umf-scalable_coarse_file
129+
- name: Run "tag" UMF tests with latest UMF libs (warnigs enabled)
130+
working-directory: ${{github.workspace}}/tag_version/build
131+
run: >
132+
UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
133+
LD_LIBRARY_PATH=${{github.workspace}}/latest_version/build/lib/
134+
ctest --output-on-failure -E "umf-provider_coarse|umf-disjointCoarseMallocPool|umf-jemalloc_coarse_file|umf-scalable_coarse_file"
135+

examples/custom_file_provider/custom_file_provider.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static umf_result_t file_get_min_page_size(void *provider, void *ptr,
234234

235235
// File provider operations
236236
static umf_memory_provider_ops_t file_ops = {
237-
.version = UMF_VERSION_CURRENT,
237+
.version = UMF_PROVIDER_OPS_VERSION_CURRENT,
238238
.initialize = file_init,
239239
.finalize = file_deinit,
240240
.alloc = file_alloc,

include/umf/memory_pool_ops.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@
1717
extern "C" {
1818
#endif
1919

20+
// TODO comment
21+
// NOTE: This is equal to the latest UMF version, in which the ops structure
22+
// has been modified.
23+
#define UMF_POOL_OPS_VERSION_CURRENT UMF_MAKE_VERSION(0, 11)
24+
2025
///
2126
/// @brief This structure comprises function pointers used by corresponding umfPool*
2227
/// calls. Each memory pool implementation should initialize all function
2328
/// pointers.
2429
///
2530
typedef struct umf_memory_pool_ops_t {
2631
/// Version of the ops structure.
27-
/// Should be initialized using UMF_VERSION_CURRENT.
32+
/// Should be initialized using UMF_POOL_OPS_VERSION_CURRENT.
2833
uint32_t version;
2934

3035
///

include/umf/memory_provider_ops.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@
1616
extern "C" {
1717
#endif
1818

19+
// TODO comment
20+
// NOTE: This is equal to the latest UMF version, in which the ops structure
21+
// has been modified.
22+
#define UMF_PROVIDER_OPS_VERSION_CURRENT UMF_MAKE_VERSION(0, 11)
23+
1924
///
2025
/// @brief This structure comprises optional function pointers used
2126
/// by corresponding umfMemoryProvider* calls. A memory provider implementation
2227
/// can keep them NULL.
2328
///
24-
typedef struct umf_memory_provider_ext_ops_t {
29+
typedef struct umf_memory_provider_ext_ops_0_11_t {
2530
///
2631
/// @brief Discard physical pages within the virtual memory mapping associated at the given addr
2732
/// and \p size. This call is asynchronous and may delay purging the pages indefinitely.
@@ -78,13 +83,14 @@ typedef struct umf_memory_provider_ext_ops_t {
7883
umf_result_t (*allocation_split)(void *hProvider, void *ptr,
7984
size_t totalSize, size_t firstSize);
8085

81-
} umf_memory_provider_ext_ops_t;
86+
} umf_memory_provider_ext_ops_0_11_t;
87+
typedef umf_memory_provider_ext_ops_0_11_t umf_memory_provider_ext_ops_t;
8288

8389
///
8490
/// @brief This structure comprises optional IPC API. The API allows sharing of
8591
/// memory objects across different processes. A memory provider implementation can keep them NULL.
8692
///
87-
typedef struct umf_memory_provider_ipc_ops_t {
93+
typedef struct umf_memory_provider_ipc_ops_0_11_t {
8894
///
8995
/// @brief Retrieve the size of opaque data structure required to store IPC data.
9096
/// @param provider pointer to the memory provider.
@@ -134,16 +140,17 @@ typedef struct umf_memory_provider_ipc_ops_t {
134140
/// UMF_RESULT_ERROR_INVALID_ARGUMENT if invalid \p ptr is passed.
135141
/// UMF_RESULT_ERROR_NOT_SUPPORTED if IPC functionality is not supported by this provider.
136142
umf_result_t (*close_ipc_handle)(void *provider, void *ptr, size_t size);
137-
} umf_memory_provider_ipc_ops_t;
143+
} umf_memory_provider_ipc_ops_0_11_t;
144+
typedef umf_memory_provider_ipc_ops_0_11_t umf_memory_provider_ipc_ops_t;
138145

139146
///
140147
/// @brief This structure comprises function pointers used by corresponding
141148
/// umfMemoryProvider* calls. Each memory provider implementation should
142149
/// initialize all function pointers.
143150
///
144-
typedef struct umf_memory_provider_ops_t {
151+
typedef struct umf_memory_provider_ops_0_11_t {
145152
/// Version of the ops structure.
146-
/// Should be initialized using UMF_VERSION_CURRENT.
153+
/// Should be initialized using UMF_PROVIDER_OPS_VERSION_CURRENT.
147154
uint32_t version;
148155

149156
///
@@ -245,7 +252,8 @@ typedef struct umf_memory_provider_ops_t {
245252
/// @brief Optional IPC ops. The API allows sharing of memory objects across different processes.
246253
///
247254
umf_memory_provider_ipc_ops_t ipc;
248-
} umf_memory_provider_ops_t;
255+
} umf_memory_provider_ops_0_11_t;
256+
typedef umf_memory_provider_ops_0_11_t umf_memory_provider_ops_t;
249257

250258
#ifdef __cplusplus
251259
}

include/umf/providers/provider_devdax_memory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ typedef enum umf_devdax_memory_provider_native_error {
6666
} umf_devdax_memory_provider_native_error_t;
6767

6868
umf_memory_provider_ops_t *umfDevDaxMemoryProviderOps(void);
69+
#define umfDevDaxMemoryProviderOps_0_11 umfDevDaxMemoryProviderOps
6970

7071
#ifdef __cplusplus
7172
}

include/umf/providers/provider_file_memory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ typedef enum umf_file_memory_provider_native_error {
6666
UMF_FILE_RESULT_ERROR_PURGE_FORCE_FAILED, ///< Force purging failed
6767
} umf_file_memory_provider_native_error_t;
6868

69+
#define umfFileMemoryProviderOps umfFileMemoryProviderOps_0_11
6970
umf_memory_provider_ops_t *umfFileMemoryProviderOps(void);
7071

7172
#ifdef __cplusplus

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ set(UMF_SOURCES
7777
memspaces/memspace_lowest_latency.c
7878
memspaces/memspace_numa.c
7979
provider/provider_cuda.c
80+
provider/provider_deprecated.c
8081
provider/provider_devdax_memory.c
8182
provider/provider_file_memory.c
8283
provider/provider_fixed_memory.c

src/cpp_helpers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ umf_result_t initialize(T *obj, ArgsTuple &&args) {
6767

6868
template <typename T> umf_memory_pool_ops_t poolOpsBase() {
6969
umf_memory_pool_ops_t ops{};
70-
ops.version = UMF_VERSION_CURRENT;
70+
ops.version = UMF_POOL_OPS_VERSION_CURRENT;
7171
ops.finalize = [](void *obj) { delete reinterpret_cast<T *>(obj); };
7272
UMF_ASSIGN_OP(ops, T, malloc, ((void *)nullptr));
7373
UMF_ASSIGN_OP(ops, T, calloc, ((void *)nullptr));
@@ -81,7 +81,7 @@ template <typename T> umf_memory_pool_ops_t poolOpsBase() {
8181

8282
template <typename T> constexpr umf_memory_provider_ops_t providerOpsBase() {
8383
umf_memory_provider_ops_t ops{};
84-
ops.version = UMF_VERSION_CURRENT;
84+
ops.version = UMF_PROVIDER_OPS_VERSION_CURRENT;
8585
ops.finalize = [](void *obj) { delete reinterpret_cast<T *>(obj); };
8686
UMF_ASSIGN_OP(ops, T, alloc, UMF_RESULT_ERROR_UNKNOWN);
8787
UMF_ASSIGN_OP(ops, T, free, UMF_RESULT_ERROR_UNKNOWN);

src/libumf.def

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@ EXPORTS
1414
umfTearDown
1515
umfGetCurrentVersion
1616
umfCloseIPCHandle
17+
umfCoarseMemoryProviderGetStats ; deprecated
18+
umfCoarseMemoryProviderOps ; deprecated
1719
umfCUDAMemoryProviderOps
1820
umfCUDAMemoryProviderParamsCreate
1921
umfCUDAMemoryProviderParamsDestroy
2022
umfCUDAMemoryProviderParamsSetContext
2123
umfCUDAMemoryProviderParamsSetDevice
2224
umfCUDAMemoryProviderParamsSetMemoryType
23-
umfDevDaxMemoryProviderOps
25+
umfDevDaxMemoryProviderOps ; deprecated
2426
umfDevDaxMemoryProviderParamsCreate
2527
umfDevDaxMemoryProviderParamsDestroy
2628
umfDevDaxMemoryProviderParamsSetDeviceDax
2729
umfDevDaxMemoryProviderParamsSetProtection
28-
umfFileMemoryProviderOps
30+
umfFileMemoryProviderOps ; deprecated
2931
umfFileMemoryProviderParamsCreate
3032
umfFileMemoryProviderParamsDestroy
3133
umfFileMemoryProviderParamsSetPath
@@ -118,6 +120,8 @@ EXPORTS
118120
umfScalablePoolParamsSetGranularity
119121
umfScalablePoolParamsSetKeepAllMemory
120122
; Added in UMF_0.11
123+
umfDevDaxMemoryProviderOps_0_11 ; redefined 0.10
124+
umfFileMemoryProviderOps_0_11 ; redefined 0.10
121125
umfFixedMemoryProviderOps
122126
umfFixedMemoryProviderParamsCreate
123127
umfFixedMemoryProviderParamsDestroy

0 commit comments

Comments
 (0)