Skip to content

Commit 0632d5f

Browse files
committed
todo
1 parent f6cbe83 commit 0632d5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+674
-506
lines changed

.github/workflows/pr_push.yml

Lines changed: 7 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -16,72 +16,10 @@ 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
40-
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-
ProxyLib:
58-
needs: [Build]
59-
uses: ./.github/workflows/reusable_proxy_lib.yml
60-
Valgrind:
61-
needs: [Build]
62-
uses: ./.github/workflows/reusable_valgrind.yml
63-
Coverage:
64-
# total coverage (on upstream only)
65-
if: github.repository == 'oneapi-src/unified-memory-framework'
66-
needs: [Build, DevDax, L0, CUDA, MultiNuma, QEMU, ProxyLib]
67-
uses: ./.github/workflows/reusable_coverage.yml
68-
secrets: inherit
69-
with:
70-
trigger: "${{github.event_name}}"
71-
Coverage_partial:
72-
# partial coverage (on forks)
73-
if: github.repository != 'oneapi-src/unified-memory-framework'
74-
needs: [Build, QEMU, ProxyLib]
75-
uses: ./.github/workflows/reusable_coverage.yml
76-
CodeQL:
77-
needs: [Build]
78-
permissions:
79-
contents: read
80-
security-events: write
81-
uses: ./.github/workflows/reusable_codeql.yml
82-
Trivy:
83-
needs: [Build]
84-
permissions:
85-
contents: read
86-
security-events: write
87-
uses: ./.github/workflows/reusable_trivy.yml
19+
Compatibility:
20+
uses: ./.github/workflows/reusable_compatibility.yml
21+
strategy:
22+
matrix:
23+
tag: ["v0.11.0-dev1"]
24+
with:
25+
tag: ${{matrix.tag}}
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# Workflow for checkig the backward compatibility of UMF.
2+
# Test the latest UMF shared library with binaries compiled using the older UMF
3+
# shared library.
4+
name: Compatibility
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
tag:
10+
description: Check backward compatibility with this tag
11+
type: string
12+
default: "v0.12.0-dev1"
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
ubuntu-build:
19+
name: Ubuntu
20+
runs-on: 'ubuntu-22.04'
21+
22+
steps:
23+
- name: Install apt packages
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y clang cmake libnuma-dev libtbb-dev
27+
28+
- name: Checkout "tag" UMF version
29+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
30+
with:
31+
fetch-depth: 0
32+
ref: refs/tags/${{inputs.tag}}
33+
path: ${{github.workspace}}/tag_version
34+
35+
- name: Install libhwloc
36+
working-directory: ${{github.workspace}}/tag_version
37+
run: .github/scripts/install_hwloc.sh
38+
39+
- name: Get "tag" UMF version
40+
working-directory: ${{github.workspace}}/tag_version
41+
run: |
42+
VERSION=$(git describe --tags)
43+
echo "tag version: $VERSION"
44+
45+
- name: Configure "tag" UMF build
46+
working-directory: ${{github.workspace}}/tag_version
47+
run: >
48+
cmake
49+
-B ${{github.workspace}}/tag_version/build
50+
-DCMAKE_BUILD_TYPE=Debug
51+
-DUMF_BUILD_SHARED_LIBRARY=ON
52+
-DCMAKE_C_COMPILER=gcc
53+
-DCMAKE_CXX_COMPILER=g++
54+
-DUMF_BUILD_TESTS=ON
55+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
56+
-DUMF_BUILD_CUDA_PROVIDER=ON
57+
-DUMF_FORMAT_CODE_STYLE=OFF
58+
-DUMF_DEVELOPER_MODE=ON
59+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
60+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
61+
-DUMF_TESTS_FAIL_ON_SKIP=ON
62+
63+
- name: Build "tag" UMF
64+
working-directory: ${{github.workspace}}/tag_version
65+
run: |
66+
cmake --build ${{github.workspace}}/tag_version/build -j $(nproc)
67+
68+
- name: Run "tag" UMF tests
69+
working-directory: ${{github.workspace}}/tag_version/build
70+
run: |
71+
LD_LIBRARY_PATH=${{github.workspace}}/tag_version/build/lib/ ctest --output-on-failure
72+
73+
- name: Checkout latest UMF version
74+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
75+
with:
76+
fetch-depth: 0
77+
path: ${{github.workspace}}/latest_version
78+
79+
- name: Get latest UMF version
80+
working-directory: ${{github.workspace}}/latest_version
81+
run: |
82+
VERSION=$(git describe --tags)
83+
echo "checked version: $VERSION"
84+
85+
- name: Configure latest UMF build
86+
working-directory: ${{github.workspace}}/latest_version
87+
run: >
88+
cmake
89+
-B ${{github.workspace}}/latest_version/build
90+
-DCMAKE_BUILD_TYPE=Debug
91+
-DUMF_BUILD_SHARED_LIBRARY=ON
92+
-DCMAKE_C_COMPILER=gcc
93+
-DCMAKE_CXX_COMPILER=g++
94+
-DUMF_BUILD_TESTS=OFF
95+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
96+
-DUMF_BUILD_CUDA_PROVIDER=ON
97+
-DUMF_FORMAT_CODE_STYLE=OFF
98+
-DUMF_DEVELOPER_MODE=ON
99+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
100+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
101+
-DUMF_TESTS_FAIL_ON_SKIP=ON
102+
103+
- name: Build latest UMF
104+
working-directory: ${{github.workspace}}/latest_version
105+
run: |
106+
cmake --build ${{github.workspace}}/latest_version/build -j $(nproc)
107+
108+
- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
109+
working-directory: ${{github.workspace}}/tag_version/build
110+
run: >
111+
UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
112+
LD_LIBRARY_PATH=${{github.workspace}}/latest_version/build/lib/
113+
ctest --output-on-failure
114+
115+
windows-build:
116+
name: Windows
117+
env:
118+
VCPKG_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows"
119+
runs-on: "windows-2022"
120+
121+
steps:
122+
- name: Checkout "tag" UMF version
123+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
124+
with:
125+
fetch-depth: 0
126+
ref: refs/tags/${{inputs.tag}}
127+
path: ${{github.workspace}}/tag_version
128+
129+
- name: Initialize vcpkg
130+
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
131+
with:
132+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
133+
vcpkgDirectory: ${{github.workspace}}/vcpkg
134+
vcpkgJsonGlob: '**/vcpkg.json'
135+
136+
- name: Install dependencies
137+
working-directory: ${{github.workspace}}/tag_version
138+
run: vcpkg install
139+
shell: pwsh # Specifies PowerShell as the shell for running the script.
140+
141+
- name: Get "tag" UMF version
142+
working-directory: ${{github.workspace}}/tag_version
143+
run: |
144+
$version = (git describe --tags)
145+
echo "tag version: $VERSION"
146+
147+
- name: Configure "tag" UMF build
148+
working-directory: ${{github.workspace}}/tag_version
149+
run: >
150+
cmake
151+
-B "${{github.workspace}}/tag_version/build"
152+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
153+
-DCMAKE_C_COMPILER=cl
154+
-DCMAKE_CXX_COMPILER=cl
155+
-DUMF_BUILD_SHARED_LIBRARY=ON
156+
-DUMF_BUILD_TESTS=ON
157+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
158+
-DUMF_BUILD_CUDA_PROVIDER=ON
159+
-DUMF_FORMAT_CODE_STYLE=OFF
160+
-DUMF_DEVELOPER_MODE=ON
161+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
162+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
163+
-DUMF_TESTS_FAIL_ON_SKIP=ON
164+
165+
- name: Build "tag" UMF
166+
run: cmake --build "${{github.workspace}}/tag_version/build" --config Debug -j $Env:NUMBER_OF_PROCESSORS
167+
168+
- name: Run "tag" UMF tests
169+
working-directory: "${{github.workspace}}/tag_version/build"
170+
run: ctest -C Debug --output-on-failure --test-dir test
171+
172+
- name: Checkout latest UMF version
173+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
174+
with:
175+
fetch-depth: 0
176+
path: ${{github.workspace}}/latest_version
177+
178+
# NOTE we use vcpkg setup from "tag" version
179+
- name: Get latest UMF version
180+
working-directory: ${{github.workspace}}/latest_version
181+
run: |
182+
$version = (git describe --tags)
183+
echo "latest version: $VERSION"
184+
185+
- name: Configure latest UMF build
186+
working-directory: ${{github.workspace}}/latest_version
187+
run: >
188+
cmake
189+
-B "${{github.workspace}}/latest_version/build"
190+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
191+
-DCMAKE_C_COMPILER=cl
192+
-DCMAKE_CXX_COMPILER=cl
193+
-DUMF_BUILD_SHARED_LIBRARY=ON
194+
-DUMF_BUILD_TESTS=OFF
195+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
196+
-DUMF_BUILD_CUDA_PROVIDER=ON
197+
-DUMF_FORMAT_CODE_STYLE=OFF
198+
-DUMF_DEVELOPER_MODE=ON
199+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
200+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
201+
-DUMF_TESTS_FAIL_ON_SKIP=ON
202+
203+
- name: Build latest UMF
204+
run: cmake --build "${{github.workspace}}/latest_version/build" --config Debug -j $Env:NUMBER_OF_PROCESSORS
205+
206+
- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
207+
working-directory: ${{github.workspace}}/tag_version/build
208+
run: |
209+
$env:UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
210+
cp ${{github.workspace}}/latest_version/build/bin/Debug/umf.dll ${{github.workspace}}/tag_version/build/bin/Debug/umf.dll
211+
ctest -C Debug --output-on-failure --test-dir test

cmake/helpers.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,10 @@ function(add_umf_target_compile_options name)
275275
/wd6326
276276
# disable 4200 warning: nonstandard extension used:
277277
# zero-sized array in struct/union
278-
/wd4200)
278+
/wd4200
279+
# disable 4815 warning: zero-sized array in stack object
280+
# will have no elements
281+
/wd4815)
279282
if(UMF_DEVELOPER_MODE)
280283
target_compile_options(${name} PRIVATE /WX)
281284
endif()

examples/custom_file_provider/custom_file_provider.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 2024 Intel Corporation
3+
* Copyright (C) 2024-2025 Intel Corporation
44
*
55
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
66
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
@@ -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.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define UMF_MEMORY_POOL_H 1
1212

1313
#include <umf/base.h>
14+
#include <umf/memory_pool_ops.h>
1415
#include <umf/memory_provider.h>
1516

1617
#ifdef __cplusplus
@@ -22,12 +23,6 @@ extern "C" {
2223
/// functions
2324
typedef struct umf_memory_pool_t *umf_memory_pool_handle_t;
2425

25-
/// @brief This structure comprises function pointers used by corresponding umfPool*
26-
/// calls. Each memory pool implementation should initialize all function
27-
/// pointers.
28-
///
29-
typedef struct umf_memory_pool_ops_t umf_memory_pool_ops_t;
30-
3126
/// @brief Supported pool creation flags
3227
typedef enum umf_pool_create_flag_t {
3328
UMF_POOL_CREATE_FLAG_NONE =

include/umf/memory_pool_ops.h

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

20+
/// @brief Version of the Memory Pool ops structure.
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
///
@@ -120,6 +125,10 @@ typedef struct umf_memory_pool_ops_t {
120125
/// The value is undefined if the previous allocation was successful.
121126
///
122127
umf_result_t (*get_last_allocation_error)(void *pool);
128+
129+
///
130+
/// @brief Extra function pointers for future extensions.
131+
void *extra[];
123132
} umf_memory_pool_ops_t;
124133

125134
#ifdef __cplusplus

include/umf/memory_provider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 2023-2024 Intel Corporation
3+
* Copyright (C) 2023-2025 Intel Corporation
44
*
55
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
66
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
@@ -179,7 +179,7 @@ umfMemoryProviderGetIPCHandle(umf_memory_provider_handle_t hProvider,
179179
void *providerIpcData);
180180

181181
///
182-
/// @brief Release IPC handle retrieved with get_ipc_handle function.
182+
/// @brief Release IPC handle retrieved with ipc_get_handle function.
183183
/// @param hProvider [in] handle to the memory provider.
184184
/// @param providerIpcData [in] pointer to the IPC opaque data structure.
185185
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.

0 commit comments

Comments
 (0)