Skip to content

Commit 38f60b0

Browse files
committed
[ur] Refactor ur_usm_pool_limits_desc_t
Remove capacity field - having a single limit for all buckets does not make much sense. It's also hard to pick a correct value without any runtime allocation statistics. Rename maxPoolSize to maxUnfreedMemory to make it more clear.
1 parent 6d7071c commit 38f60b0

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

include/ur.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -903,10 +903,9 @@ class ur_usm_pool_limits_desc_t(Structure):
903903
("stype", ur_structure_type_t), ## [in] type of this structure, must be
904904
## ::UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC
905905
("pNext", c_void_p), ## [in][optional] pointer to extension-specific structure
906-
("maxPoolSize", c_size_t), ## [in] Maximum size of a memory pool
906+
("maxUnfreedMemory", c_size_t), ## [in] Maximum amount of free memory kept in the pool
907907
("maxPoolableSize", c_size_t), ## [in] Allocations up to this limit will be subject to pooling
908-
("capacity", c_size_t), ## [in] When pooling, each bucket will hold a max of 4 unfreed slabs
909-
("slabMinSize", c_size_t) ## [in] Minimum allocation size that will be requested from the driver
908+
("minDriverAllocSize", c_size_t) ## [in] Minimum allocation size that will be requested from the driver
910909
]
911910

912911
###############################################################################

include/ur_api.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -2081,10 +2081,9 @@ typedef struct ur_usm_pool_limits_desc_t {
20812081
ur_structure_type_t stype; ///< [in] type of this structure, must be
20822082
///< ::UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC
20832083
const void *pNext; ///< [in][optional] pointer to extension-specific structure
2084-
size_t maxPoolSize; ///< [in] Maximum size of a memory pool
2084+
size_t maxUnfreedMemory; ///< [in] Maximum amount of free memory kept in the pool
20852085
size_t maxPoolableSize; ///< [in] Allocations up to this limit will be subject to pooling
2086-
size_t capacity; ///< [in] When pooling, each bucket will hold a max of 4 unfreed slabs
2087-
size_t slabMinSize; ///< [in] Minimum allocation size that will be requested from the driver
2086+
size_t minDriverAllocSize; ///< [in] Minimum allocation size that will be requested from the driver
20882087

20892088
} ur_usm_pool_limits_desc_t;
20902089

scripts/core/usm.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,13 @@ name: $x_usm_pool_limits_desc_t
130130
base: $x_base_desc_t
131131
members:
132132
- type: "size_t"
133-
name: maxPoolSize
134-
desc: "[in] Maximum size of a memory pool"
133+
name: maxUnfreedMemory
134+
desc: "[in] Maximum amount of free memory kept in the pool"
135135
- type: "size_t"
136136
name: maxPoolableSize
137137
desc: "[in] Allocations up to this limit will be subject to pooling"
138138
- type: "size_t"
139-
name: capacity
140-
desc: "[in] When pooling, each bucket will hold a max of 4 unfreed slabs"
141-
- type: "size_t"
142-
name: slabMinSize
139+
name: minDriverAllocSize
143140
desc: "[in] Minimum allocation size that will be requested from the driver"
144141
--- #--------------------------------------------------------------------------
145142
type: function

0 commit comments

Comments
 (0)