Skip to content

Commit c2024af

Browse files
authored
Merge pull request #1160 from oneapi-src/main
update v0.12.x-dev
2 parents b6ec7a3 + feeb424 commit c2024af

File tree

57 files changed

+620
-228
lines changed

Some content is hidden

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

57 files changed

+620
-228
lines changed

.github/workflows/nightly.yml

+60
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,66 @@ jobs:
151151
working-directory: ${{env.BUILD_DIR}}
152152
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
153153

154+
Windows-NMake:
155+
name: Windows-NMake
156+
env:
157+
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
158+
BUILD_DIR : "${{github.workspace}}/build"
159+
strategy:
160+
matrix:
161+
os: ['windows-2019', 'windows-2022']
162+
build_type: [Debug, Release]
163+
compiler: [{c: cl, cxx: cl}]
164+
shared_library: ['ON', 'OFF']
165+
166+
runs-on: ${{matrix.os}}
167+
168+
steps:
169+
- name: Checkout
170+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
171+
with:
172+
fetch-depth: 0
173+
174+
- name: Initialize vcpkg
175+
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
176+
with:
177+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
178+
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
179+
vcpkgJsonGlob: '**/vcpkg.json'
180+
181+
- name: Install dependencies
182+
run: vcpkg install
183+
184+
- name: Configure MSVC environment
185+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
186+
187+
- name: Configure build
188+
run: >
189+
cmake
190+
-B ${{env.BUILD_DIR}}
191+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
192+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
193+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
194+
-G "NMake Makefiles"
195+
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
196+
-DUMF_LINK_HWLOC_STATICALLY=ON
197+
-DUMF_FORMAT_CODE_STYLE=OFF
198+
-DUMF_DEVELOPER_MODE=ON
199+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
200+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
201+
-DUMF_BUILD_CUDA_PROVIDER=ON
202+
-DUMF_TESTS_FAIL_ON_SKIP=ON
203+
204+
- name: Build UMF
205+
shell: cmd
206+
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j %NUMBER_OF_PROCESSORS%
207+
208+
- name: Run tests
209+
shell: cmd
210+
working-directory: ${{env.BUILD_DIR}}
211+
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
212+
213+
154214
icx:
155215
name: ICX
156216
env:

.github/workflows/reusable_benchmarks.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ jobs:
103103
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
104104
with:
105105
repository: intel/llvm
106-
ref: nightly-2025-02-19
106+
# add preloaded UMF benchmarks
107+
# https://github.com/intel/llvm/pull/17278
108+
ref: b2f9dab5266d227cc9eb19af1b54c5bdc50221d1
107109
path: sycl-repo
108110
fetch-depth: 1
109111

.github/workflows/reusable_dax.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ env:
3131
INSTL_DIR : "${{github.workspace}}/../install-dir"
3232
COVERAGE_DIR : "${{github.workspace}}/coverage"
3333
COVERAGE_NAME : "exports-coverage-dax"
34-
DAX_TESTS: "./test/umf_test-provider_file_memory ./test/umf_test-provider_devdax_memory"
34+
DAX_TESTS: "./test/test_provider_file_memory ./test/test_provider_devdax_memory"
3535

3636
jobs:
3737
dax:

.github/workflows/reusable_multi_numa.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
BUILD_DIR : "${{github.workspace}}/build"
1111
COVERAGE_DIR : "${{github.workspace}}/coverage"
1212
COVERAGE_NAME : "exports-coverage-multinuma"
13-
NUMA_TESTS: "./test/umf_test-memspace_numa ./test/umf_test-provider_os_memory_multiple_numa_nodes"
13+
NUMA_TESTS: "./test/test_memspace_numa ./test/test_provider_os_memory_multiple_numa_nodes"
1414

1515
jobs:
1616
multi_numa:
@@ -60,13 +60,13 @@ jobs:
6060
# On RHEL, hwloc version is just a little too low.
6161
# Skip some tests until we upgrade hwloc and update CMake to properly handle local hwloc installation.
6262
# TODO: fix issue #560
63-
# TODO: add issue for -E umf-init_teardown - it is not clear why it fails
63+
# TODO: add issue for -E test_init_teardown - it is not clear why it fails
6464
- name: Run tests (on RHEL)
6565
if: matrix.os == 'rhel-9.1'
6666
working-directory: ${{github.workspace}}/build
6767
run: |
68-
ctest --output-on-failure --test-dir test -E "umf-provider_os_memory_multiple_numa_nodes|umf-init_teardown"
69-
./test/umf_test-provider_os_memory_multiple_numa_nodes \
68+
ctest --output-on-failure --test-dir test -E "test_provider_os_memory_multiple_numa_nodes|test_init_teardown"
69+
./test/test_provider_os_memory_multiple_numa_nodes \
7070
--gtest_filter="-*checkModeLocal/*:*checkModePreferredEmptyNodeset/*:testNuma.checkModeInterleave"
7171
7272
- name: Run NUMA tests under valgrind

.github/workflows/reusable_proxy_lib.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ jobs:
5959
working-directory: ${{env.BUILD_DIR}}
6060
run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure
6161

62-
- name: Run "./test/umf_test-memoryPool" with proxy library
62+
- name: Run "./test/test_memoryPool" with proxy library
6363
working-directory: ${{env.BUILD_DIR}}
64-
run: LD_PRELOAD=./lib/libumf_proxy.so ./test/umf_test-memoryPool
64+
run: LD_PRELOAD=./lib/libumf_proxy.so ./test/test_memoryPool
6565

6666
- name: Run "/usr/bin/ls" with proxy library
6767
working-directory: ${{env.BUILD_DIR}}

benchmark/benchmark.cpp

+76-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
9696
pool_allocator<disjoint_pool<os_provider>>);
9797
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, disjoint_pool_uniform)
9898
->Apply(&default_multiple_alloc_uniform_size)
99-
->Apply(&singlethreaded);
100-
// TODO: change to multithreaded
101-
//->Apply(&multithreaded);
99+
->Apply(&multithreaded);
102100

103101
#ifdef UMF_POOL_JEMALLOC_ENABLED
104102
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark, jemalloc_pool_fix,
@@ -136,6 +134,81 @@ UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, scalable_pool_uniform)
136134

137135
#endif
138136

137+
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
138+
proxy_pool_fixedprovider, fixed_alloc_size,
139+
pool_allocator<proxy_pool<fixed_provider>>);
140+
141+
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
142+
proxy_pool_fixedprovider)
143+
->Apply(&default_multiple_alloc_fix_size)
144+
->Apply(&singlethreaded);
145+
146+
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark, fixed_provider,
147+
fixed_alloc_size,
148+
provider_allocator<fixed_provider>);
149+
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, fixed_provider)
150+
->Apply(&default_multiple_alloc_fix_size)
151+
->Apply(&singlethreaded);
152+
153+
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
154+
disjoint_pool_fix_fixedprovider, fixed_alloc_size,
155+
pool_allocator<disjoint_pool<fixed_provider>>);
156+
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
157+
disjoint_pool_fix_fixedprovider)
158+
->Apply(&default_multiple_alloc_fix_size)
159+
->Apply(&multithreaded);
160+
161+
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
162+
disjoint_pool_uniform_fixedprovider,
163+
uniform_alloc_size,
164+
pool_allocator<disjoint_pool<fixed_provider>>);
165+
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
166+
disjoint_pool_uniform_fixedprovider)
167+
->Apply(&default_multiple_alloc_uniform_size)
168+
->Apply(&singlethreaded);
169+
// TODO: change to multithreaded
170+
//->Apply(&multithreaded);
171+
172+
#ifdef UMF_POOL_JEMALLOC_ENABLED
173+
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
174+
jemalloc_pool_fixedprovider, fixed_alloc_size,
175+
pool_allocator<jemalloc_pool<fixed_provider>>);
176+
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, jemalloc_pool_fix)
177+
->Apply(&default_multiple_alloc_fix_size)
178+
->Apply(&multithreaded);
179+
180+
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
181+
jemalloc_pool_uniform_fixedprovider,
182+
uniform_alloc_size,
183+
pool_allocator<jemalloc_pool<fixed_provider>>);
184+
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark, jemalloc_pool_uniform)
185+
->Apply(&default_multiple_alloc_uniform_size)
186+
->Apply(&multithreaded);
187+
188+
#endif
189+
190+
#ifdef UMF_POOL_SCALABLE_ENABLED
191+
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
192+
scalable_pool_fix_fixedprovider, fixed_alloc_size,
193+
pool_allocator<scalable_pool<fixed_provider>>);
194+
195+
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
196+
scalable_pool_fix_fixedprovider)
197+
->Apply(&default_multiple_alloc_fix_size)
198+
->Apply(&multithreaded);
199+
200+
UMF_BENCHMARK_TEMPLATE_DEFINE(multiple_malloc_free_benchmark,
201+
scalable_pool_uniform_fixedprovider,
202+
uniform_alloc_size,
203+
pool_allocator<scalable_pool<fixed_provider>>);
204+
205+
UMF_BENCHMARK_REGISTER_F(multiple_malloc_free_benchmark,
206+
scalable_pool_uniform_fixedprovider)
207+
->Apply(&default_multiple_alloc_uniform_size)
208+
->Apply(&multithreaded);
209+
210+
#endif
211+
139212
//BENCHMARK_MAIN();
140213
int main(int argc, char **argv) {
141214
if (initAffinityMask()) {

benchmark/benchmark_umf.hpp

+60-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#ifdef UMF_POOL_SCALABLE_ENABLED
2020
#include <umf/pools/pool_scalable.h>
2121
#endif
22+
#include <umf/providers/provider_fixed_memory.h>
2223
#include <umf/providers/provider_os_memory.h>
2324

2425
#ifdef UMF_POOL_JEMALLOC_ENABLED
@@ -145,7 +146,9 @@ struct os_provider : public provider_interface {
145146
umfOsMemoryProviderParamsDestroy(handle);
146147
};
147148

148-
return {static_cast<void *>(raw_params), deleter};
149+
return {static_cast<provider_interface::params_ptr::element_type *>(
150+
raw_params),
151+
deleter};
149152
}
150153

151154
umf_memory_provider_ops_t *
@@ -155,6 +158,62 @@ struct os_provider : public provider_interface {
155158
static std::string name() { return "os_provider"; }
156159
};
157160

161+
struct fixed_provider : public provider_interface {
162+
private:
163+
char *mem = NULL;
164+
const size_t size = 1024 * 1024 * 1024; // 1GB
165+
public:
166+
virtual void SetUp(::benchmark::State &state) override {
167+
if (state.thread_index() != 0) {
168+
return;
169+
}
170+
171+
if (!mem) {
172+
mem = new char[size];
173+
}
174+
175+
provider_interface::SetUp(state);
176+
}
177+
178+
virtual void TearDown(::benchmark::State &state) override {
179+
if (state.thread_index() != 0) {
180+
return;
181+
}
182+
183+
delete[] mem;
184+
mem = nullptr;
185+
186+
provider_interface::TearDown(state);
187+
}
188+
189+
provider_interface::params_ptr
190+
getParams(::benchmark::State &state) override {
191+
umf_fixed_memory_provider_params_handle_t raw_params = nullptr;
192+
umfFixedMemoryProviderParamsCreate(&raw_params, mem, size);
193+
if (!raw_params) {
194+
state.SkipWithError("Failed to create fixed provider params");
195+
return {nullptr, [](void *) {}};
196+
}
197+
198+
// Use a lambda as the custom deleter
199+
auto deleter = [](void *p) {
200+
auto handle =
201+
static_cast<umf_fixed_memory_provider_params_handle_t>(p);
202+
umfFixedMemoryProviderParamsDestroy(handle);
203+
};
204+
205+
return {static_cast<provider_interface::params_ptr::element_type *>(
206+
raw_params),
207+
deleter};
208+
}
209+
210+
umf_memory_provider_ops_t *
211+
getOps([[maybe_unused]] ::benchmark::State &state) override {
212+
return umfFixedMemoryProviderOps();
213+
}
214+
static std::string name() { return "fixed_provider"; }
215+
};
216+
158217
template <typename Provider>
159218
struct proxy_pool : public pool_interface<Provider> {
160219
umf_memory_pool_ops_t *

0 commit comments

Comments
 (0)