Skip to content

Commit d4cc2a3

Browse files
committed
add set name to all pools and providers
1 parent fe3aea6 commit d4cc2a3

29 files changed

+683
-17
lines changed

include/umf/pools/pool_disjoint.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ umf_result_t umfDisjointPoolParamsSetSharedLimits(
109109

110110
/// @brief Set custom name of the disjoint pool to be used in the traces.
111111
/// @param hParams handle to the parameters of the disjoint pool.
112-
/// @param name custom name of the pool. Name longer than 64 characters will be truncated.
112+
/// @param name custom name of the pool. Must not be NULL. Name longer than 64
113+
/// characters will be truncated.
113114
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
114115
umf_result_t
115116
umfDisjointPoolParamsSetName(umf_disjoint_pool_params_handle_t hParams,

include/umf/pools/pool_jemalloc.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ umf_result_t
4343
umfJemallocPoolParamsSetNumArenas(umf_jemalloc_pool_params_handle_t hParams,
4444
size_t numArenas);
4545

46+
/// @brief Set custom name of the jemalloc pool used in traces.
47+
/// @param hParams handle to the parameters of the jemalloc pool.
48+
/// @param name custom name. Must not be NULL. Name longer than 63 characters
49+
/// will be truncated.
50+
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
51+
umf_result_t
52+
umfJemallocPoolParamsSetName(umf_jemalloc_pool_params_handle_t hParams,
53+
const char *name);
54+
4655
const umf_memory_pool_ops_t *umfJemallocPoolOps(void);
4756

4857
#ifdef __cplusplus

include/umf/pools/pool_scalable.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ umf_result_t
5353
umfScalablePoolParamsSetKeepAllMemory(umf_scalable_pool_params_handle_t hParams,
5454
bool keepAllMemory);
5555

56+
/// @brief Set custom name of the scalable pool used in traces.
57+
/// @param hParams handle to the parameters of the scalable pool.
58+
/// @param name custom name. Must not be NULL. Name longer than 63 characters
59+
/// will be truncated.
60+
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
61+
umf_result_t
62+
umfScalablePoolParamsSetName(umf_scalable_pool_params_handle_t hParams,
63+
const char *name);
64+
5665
/// @brief Return \p ops structure containing pointers to the scalable pool implementation.
5766
/// @return pointer to the \p umf_memory_pool_ops_t struct.
5867
const umf_memory_pool_ops_t *umfScalablePoolOps(void);

include/umf/providers/provider_cuda.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ umf_result_t umfCUDAMemoryProviderParamsSetMemoryType(
6161
umf_result_t umfCUDAMemoryProviderParamsSetAllocFlags(
6262
umf_cuda_memory_provider_params_handle_t hParams, unsigned int flags);
6363

64+
/// @brief Set custom name of the CUDA Memory Provider.
65+
/// @param hParams handle to the parameters of the CUDA Memory Provider.
66+
/// @param name custom name. Must not be NULL. Name longer than 63 characters
67+
/// will be truncated.
68+
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
69+
umf_result_t umfCUDAMemoryProviderParamsSetName(
70+
umf_cuda_memory_provider_params_handle_t hParams, const char *name);
71+
6472
const umf_memory_provider_ops_t *umfCUDAMemoryProviderOps(void);
6573

6674
#ifdef __cplusplus

include/umf/providers/provider_devdax_memory.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ umf_result_t umfDevDaxMemoryProviderParamsSetDeviceDax(
5656
umf_result_t umfDevDaxMemoryProviderParamsSetProtection(
5757
umf_devdax_memory_provider_params_handle_t hParams, unsigned protection);
5858

59+
/// @brief Set custom name of the Devdax Memory Provider.
60+
/// @param hParams handle to the parameters of the Devdax Memory Provider.
61+
/// @param name custom name. Must not be NULL. Name longer than 63 characters
62+
/// will be truncated.
63+
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
64+
umf_result_t umfDevDaxMemoryProviderParamsSetName(
65+
umf_devdax_memory_provider_params_handle_t hParams, const char *name);
66+
5967
/// @brief Devdax Memory Provider operation results
6068
typedef enum umf_devdax_memory_provider_native_error {
6169
UMF_DEVDAX_RESULT_SUCCESS = UMF_DEVDAX_RESULTS_START_FROM, ///< Success

include/umf/providers/provider_file_memory.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ typedef enum umf_file_memory_provider_native_error {
6868

6969
const umf_memory_provider_ops_t *umfFileMemoryProviderOps(void);
7070

71+
/// @brief Set custom name of the File Memory Provider.
72+
/// @param hParams handle to the parameters of the File Memory Provider.
73+
/// @param name custom name. Must not be NULL. Name longer than 63 characters
74+
/// will be truncated.
75+
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
76+
umf_result_t umfFileMemoryProviderParamsSetName(
77+
umf_file_memory_provider_params_handle_t hParams, const char *name);
78+
7179
#ifdef __cplusplus
7280
}
7381
#endif

include/umf/providers/provider_fixed_memory.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ umf_result_t umfFixedMemoryProviderParamsDestroy(
5151
/// @return Pointer to the umf_memory_provider_ops_t structure.
5252
const umf_memory_provider_ops_t *umfFixedMemoryProviderOps(void);
5353

54+
/// @brief Set custom name of the Fixed Memory Provider.
55+
/// @param hParams [in] handle to the parameters of the Fixed Memory Provider.
56+
/// @param name custom name. Must not be NULL. Name longer than 63 characters
57+
/// will be truncated.
58+
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
59+
umf_result_t umfFixedMemoryProviderParamsSetName(
60+
umf_fixed_memory_provider_params_handle_t hParams, const char *name);
61+
5462
/// @brief Fixed Memory Provider operation results
5563
typedef enum umf_fixed_memory_provider_native_error {
5664
UMF_FIXED_RESULT_SUCCESS = UMF_FIXED_RESULTS_START_FROM, ///< Success

include/umf/providers/provider_level_zero.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetDeviceOrdinal(
9191
umf_level_zero_memory_provider_params_handle_t hParams,
9292
uint32_t deviceOrdinal);
9393

94+
/// @brief Set custom name of the Level Zero Memory Provider.
95+
/// @param hParams handle to the parameters of the Level Zero Memory Provider.
96+
/// @param name custom name. Must not be NULL. Name longer than 63 characters
97+
/// will be truncated.
98+
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
99+
umf_result_t umfLevelZeroMemoryProviderParamsSetName(
100+
umf_level_zero_memory_provider_params_handle_t hParams, const char *name);
101+
94102
const umf_memory_provider_ops_t *umfLevelZeroMemoryProviderOps(void);
95103

96104
#ifdef __cplusplus

include/umf/providers/provider_os_memory.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ umf_result_t umfOsMemoryProviderParamsSetPartitions(
134134
umf_os_memory_provider_params_handle_t hParams,
135135
umf_numa_split_partition_t *partitions, unsigned partitions_len);
136136

137+
/// @brief Set custom name of the OS memory provider.
138+
/// @param hParams handle to the parameters of the OS memory provider.
139+
/// @param name custom name. Must not be NULL. Name longer than 63 characters
140+
/// will be truncated.
141+
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
142+
umf_result_t
143+
umfOsMemoryProviderParamsSetName(umf_os_memory_provider_params_handle_t hParams,
144+
const char *name);
145+
137146
/// @brief OS Memory Provider operation results
138147
typedef enum umf_os_memory_provider_native_error {
139148
UMF_OS_RESULT_SUCCESS = UMF_OS_RESULTS_START_FROM, ///< Success

src/libumf.def

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,12 @@ EXPORTS
144144
umfJemallocPoolParamsDestroy
145145
umfJemallocPoolParamsSetNumArenas
146146
umfPoolGetName
147+
; Added in UMF_1.1
148+
umfCUDAMemoryProviderParamsSetName
149+
umfDevDaxMemoryProviderParamsSetName
150+
umfFileMemoryProviderParamsSetName
151+
umfFixedMemoryProviderParamsSetName
152+
umfJemallocPoolParamsSetName
153+
umfLevelZeroMemoryProviderParamsSetName
154+
umfOsMemoryProviderParamsSetName
155+
umfScalablePoolParamsSetName

0 commit comments

Comments
 (0)