Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e5d8739
Add resident device change call
lslusarczyk Aug 25, 2025
8c54695
added missing doxygen documentation
lslusarczyk Sep 11, 2025
064d1ac
fix documentation spelling
lslusarczyk Sep 12, 2025
c4a7499
applied Rafal's comments
lslusarczyk Sep 12, 2025
588d1af
fixed compilation error
lslusarczyk Sep 12, 2025
b24574c
applied second round of Rafal's comments
lslusarczyk Sep 12, 2025
5983cfa
applied Lukasz's comments
lslusarczyk Sep 15, 2025
5cbbad2
one more missed Lukasz comment applied
lslusarczyk Sep 15, 2025
c27407a
added some tests for resident device feature
lslusarczyk Sep 15, 2025
53ec753
add unittests and refactor to be backward compatible
lslusarczyk Sep 16, 2025
01d74ba
moved umfMemoryProviderResidentDeviceChange down
lslusarczyk Sep 19, 2025
0bc9a29
added empty line for Rafal :)
lslusarczyk Sep 19, 2025
d13a3ef
cmake format fixed
lslusarczyk Sep 19, 2025
272bd66
Lukasz and Rafal comments applied
lslusarczyk Sep 22, 2025
cabd5e7
fix log test
lslusarczyk Sep 22, 2025
7de5b15
removed usless ext_resident_device_change from memory_pool
lslusarczyk Sep 22, 2025
32ebea7
use umfLevelZeroMemoryProviderResidentDeviceChange instead of ops
lslusarczyk Sep 22, 2025
50db5c5
reverted log change as it was moved to different PR
lslusarczyk Sep 22, 2025
780794c
removed accidental changes
lslusarczyk Sep 22, 2025
4f75bca
fix doc
lslusarczyk Sep 22, 2025
9f1c588
applied Lukasz S. comments
lslusarczyk Sep 23, 2025
3f4db4f
change ze_api include due to windows compile error
lslusarczyk Sep 23, 2025
cf4254a
fix link in windows
lslusarczyk Sep 23, 2025
7bd5c24
not using utils_log in ze_loopback
lslusarczyk Sep 24, 2025
dbb8298
fix includes for level_zero_mocks.cpp
lslusarczyk Sep 24, 2025
58fae70
windows use _putenv_s instead of setenv
lslusarczyk Sep 25, 2025
53bfcb0
TestCreatePointer fix
lslusarczyk Sep 25, 2025
822f278
more windows fixes
lslusarczyk Sep 25, 2025
340bfb1
windows next fix attempt
lslusarczyk Sep 25, 2025
fad510c
fixed sharedlib compilation
lslusarczyk Sep 26, 2025
636477a
removed pkg_check_modules ZE_LOADER
lslusarczyk Sep 26, 2025
a6e456e
change ZE_LOADER_INCLUDE_DIRS into LEVEL_ZERO_INCLUDE_DIRS
lslusarczyk Sep 26, 2025
877a36e
fix includes for umf_test_mocks and umf_ze_loopback
lslusarczyk Sep 26, 2025
6b0e070
maybe UMF_UTIL_OPEN_LIBRARY_NO_LOAD was wrong?
lslusarczyk Sep 27, 2025
0498da7
ze_dll or ze_api export missing?
lslusarczyk Sep 29, 2025
e9ccf45
dll path fix
lslusarczyk Sep 29, 2025
d30da26
back with UMF_UTIL_OPEN_LIBRARY_NO_LOAD?
lslusarczyk Sep 29, 2025
29a706d
add_library changed to add_umf_library
lslusarczyk Sep 29, 2025
5713a96
fix dllexport used more than once
lslusarczyk Sep 29, 2025
134e16b
see logs in case of residency tests failure
lslusarczyk Sep 29, 2025
5adb37c
utils_rwlock_init fix
lslusarczyk Sep 29, 2025
058bf8d
some logs upon free and add closing library
lslusarczyk Sep 29, 2025
4803c47
typo fix
lslusarczyk Sep 29, 2025
a3cc32e
fix LevelZeroMock::initializeMemoryProviderWithResidentDevices with P…
lslusarczyk Sep 29, 2025
5b7f61a
remove not needed free logs
lslusarczyk Sep 29, 2025
0bf7cbd
UBA does not accept NULL in memcpy source even with size==0
lslusarczyk Sep 30, 2025
e0af7eb
fix wrong type in zeMemAlloc* functions
lslusarczyk Sep 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/umf/memory_pool_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ typedef struct umf_memory_pool_ops_t {
///
/// @return umf_result_t result of the control operation.
///
umf_result_t (*ext_ctl)(void *hPool, umf_ctl_query_source_t source,
umf_result_t (*ext_ctl)(void *pool, umf_ctl_query_source_t source,
const char *name, void *arg, size_t size,
umf_ctl_query_type_t queryType, va_list args);

Expand Down
13 changes: 13 additions & 0 deletions include/umf/providers/provider_level_zero.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#ifndef UMF_LEVEL_ZERO_PROVIDER_H
#define UMF_LEVEL_ZERO_PROVIDER_H

#include <stdbool.h>

#include <umf/memory_provider_gpu.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -101,6 +103,17 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetDeviceOrdinal(
umf_result_t umfLevelZeroMemoryProviderParamsSetName(
umf_level_zero_memory_provider_params_handle_t hParams, const char *name);

/// @brief Adds or removes devices on which allocations should be made
/// resident.
/// @param provider handle to the memory provider
/// @param device device handle
/// @param is_adding Boolean indicating if peer is to be removed or added
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on
/// failure.
umf_result_t umfLevelZeroMemoryProviderResidentDeviceChange(
umf_memory_provider_handle_t provider, ze_device_handle_t device,
bool is_adding);

const umf_memory_provider_ops_t *umfLevelZeroMemoryProviderOps(void);

#ifdef __cplusplus
Expand Down
15 changes: 14 additions & 1 deletion src/critnib/critnib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,8 @@ int critnib_find(struct critnib *c, uintptr_t key, enum find_dir_t dir,
*
* If func() returns non-zero, the search is aborted.
*/
static int iter(struct critnib_node *__restrict n, word min, word max,
static int iter(struct critnib_node *__restrict n, const word min,
const word max,
int (*func)(word key, void *value, void *privdata),
void *privdata) {
if (is_leaf(n)) {
Expand Down Expand Up @@ -1129,9 +1130,21 @@ static int iter(struct critnib_node *__restrict n, word min, word max,
void critnib_iter(critnib *c, uintptr_t min, uintptr_t max,
int (*func)(uintptr_t key, void *value, void *privdata),
void *privdata) {
bool wasIterating = false;
utils_mutex_lock(&c->mutex);
if (c->root) {
iter(c->root, min, max, func, privdata);
wasIterating = true;
}
utils_mutex_unlock(&c->mutex);
if (!wasIterating) {
LOG_DEBUG("there was no root, iterating critnib: %p was skipped",
(void *)c);
}
}

void critnib_iter_all(critnib *c,
int (*func)(uintptr_t key, void *value, void *privdata),
void *privdata) {
critnib_iter(c, 0, (uintptr_t)-1, func, privdata);
}
4 changes: 4 additions & 0 deletions src/critnib/critnib.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ int critnib_insert(critnib *c, uintptr_t key, void *value, int update);
void critnib_iter(critnib *c, uintptr_t min, uintptr_t max,
int (*func)(uintptr_t key, void *value, void *privdata),
void *privdata);
void critnib_iter_all(critnib *c,
int (*func)(uintptr_t key, void *value, void *privdata),
void *privdata);

int critnib_remove_release(critnib *c, uintptr_t key);

/*
Expand Down
1 change: 1 addition & 0 deletions src/libumf.def
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ EXPORTS
umfLevelZeroMemoryProviderParamsSetDevice
umfLevelZeroMemoryProviderParamsSetMemoryType
umfLevelZeroMemoryProviderParamsSetResidentDevices
umfLevelZeroMemoryProviderResidentDeviceChange
umfMemoryProviderAlloc
umfMemoryProviderAllocationMerge
umfMemoryProviderAllocationSplit
Expand Down
1 change: 1 addition & 0 deletions src/libumf.map
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ UMF_1.1 {
umfGetMemoryPropertySize;
umfJemallocPoolParamsSetName;
umfLevelZeroMemoryProviderParamsSetName;
umfLevelZeroMemoryProviderResidentDeviceChange;
umfOsMemoryProviderParamsSetName;
umfPoolTrimMemory;
umfScalablePoolParamsSetName;
Expand Down
Loading
Loading