Skip to content

Commit 90d93a6

Browse files
authored
Merge pull request #2165 from aarongreig/aaron/makeUSMPoolsOptional
Make USM pools optional with a device query to report support.
2 parents 60dc719 + bf24ee3 commit 90d93a6

26 files changed

+162
-185
lines changed

include/ur_api.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,9 @@ typedef enum ur_device_info_t {
16391639
UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT = 118, ///< [::ur_bool_t] return true if the device supports the
16401640
///< `EnqueueDeviceGlobalVariableWrite` and
16411641
///< `EnqueueDeviceGlobalVariableRead` entry points.
1642+
UR_DEVICE_INFO_USM_POOL_SUPPORT = 119, ///< [::ur_bool_t] return true if the device supports USM pooling. Pertains
1643+
///< to the `USMPool` entry points and usage of the `pool` parameter of the
1644+
///< USM alloc entry points.
16421645
UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000, ///< [::ur_bool_t] Returns true if the device supports the use of
16431646
///< command-buffers.
16441647
UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_CAPABILITIES_EXP = 0x1001, ///< [::ur_device_command_buffer_update_capability_flags_t] Command-buffer
@@ -3503,7 +3506,6 @@ typedef struct ur_usm_pool_limits_desc_t {
35033506
/// @brief USM allocate host memory
35043507
///
35053508
/// @details
3506-
/// - This function must support memory pooling.
35073509
/// - If pUSMDesc is not NULL and pUSMDesc->pool is not NULL the allocation
35083510
/// will be served from a specified memory pool.
35093511
/// - Otherwise, the behavior is implementation-defined.
@@ -3536,6 +3538,8 @@ typedef struct ur_usm_pool_limits_desc_t {
35363538
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
35373539
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
35383540
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
3541+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
3542+
/// + If any device associated with `hContext` reports `false` for ::UR_DEVICE_INFO_USM_POOL_SUPPORT
35393543
UR_APIEXPORT ur_result_t UR_APICALL
35403544
urUSMHostAlloc(
35413545
ur_context_handle_t hContext, ///< [in] handle of the context object
@@ -3549,7 +3553,6 @@ urUSMHostAlloc(
35493553
/// @brief USM allocate device memory
35503554
///
35513555
/// @details
3552-
/// - This function must support memory pooling.
35533556
/// - If pUSMDesc is not NULL and pUSMDesc->pool is not NULL the allocation
35543557
/// will be served from a specified memory pool.
35553558
/// - Otherwise, the behavior is implementation-defined.
@@ -3583,6 +3586,8 @@ urUSMHostAlloc(
35833586
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
35843587
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
35853588
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
3589+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
3590+
/// + If any device associated with `hContext` reports `false` for ::UR_DEVICE_INFO_USM_POOL_SUPPORT
35863591
UR_APIEXPORT ur_result_t UR_APICALL
35873592
urUSMDeviceAlloc(
35883593
ur_context_handle_t hContext, ///< [in] handle of the context object
@@ -3597,7 +3602,6 @@ urUSMDeviceAlloc(
35973602
/// @brief USM allocate shared memory
35983603
///
35993604
/// @details
3600-
/// - This function must support memory pooling.
36013605
/// - If pUSMDesc is not NULL and pUSMDesc->pool is not NULL the allocation
36023606
/// will be served from a specified memory pool.
36033607
/// - Otherwise, the behavior is implementation-defined.
@@ -3632,6 +3636,8 @@ urUSMDeviceAlloc(
36323636
/// + If `UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT` and `UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT` are both false.
36333637
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
36343638
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
3639+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
3640+
/// + If any device associated with `hContext` reports `false` for ::UR_DEVICE_INFO_USM_POOL_SUPPORT
36353641
UR_APIEXPORT ur_result_t UR_APICALL
36363642
urUSMSharedAlloc(
36373643
ur_context_handle_t hContext, ///< [in] handle of the context object
@@ -3713,6 +3719,8 @@ urUSMGetMemAllocInfo(
37133719
/// + `::UR_USM_POOL_FLAGS_MASK & pPoolDesc->flags`
37143720
/// - ::UR_RESULT_ERROR_INVALID_VALUE
37153721
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
3722+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
3723+
/// + If any device associated with `hContext` reports `false` for ::UR_DEVICE_INFO_USM_POOL_SUPPORT
37163724
UR_APIEXPORT ur_result_t UR_APICALL
37173725
urUSMPoolCreate(
37183726
ur_context_handle_t hContext, ///< [in] handle of the context object
@@ -3731,6 +3739,7 @@ urUSMPoolCreate(
37313739
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
37323740
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
37333741
/// + `NULL == pPool`
3742+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
37343743
UR_APIEXPORT ur_result_t UR_APICALL
37353744
urUSMPoolRetain(
37363745
ur_usm_pool_handle_t pPool ///< [in][retain] pointer to USM memory pool
@@ -3753,6 +3762,7 @@ urUSMPoolRetain(
37533762
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
37543763
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
37553764
/// + `NULL == pPool`
3765+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
37563766
UR_APIEXPORT ur_result_t UR_APICALL
37573767
urUSMPoolRelease(
37583768
ur_usm_pool_handle_t pPool ///< [in][release] pointer to USM memory pool
@@ -3794,6 +3804,7 @@ typedef enum ur_usm_pool_info_t {
37943804
/// + `pPropValue == NULL && pPropSizeRet == NULL`
37953805
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
37963806
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
3807+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
37973808
UR_APIEXPORT ur_result_t UR_APICALL
37983809
urUSMPoolGetInfo(
37993810
ur_usm_pool_handle_t hPool, ///< [in] handle of the USM memory pool

include/ur_print.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,6 +2550,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
25502550
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
25512551
os << "UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT";
25522552
break;
2553+
case UR_DEVICE_INFO_USM_POOL_SUPPORT:
2554+
os << "UR_DEVICE_INFO_USM_POOL_SUPPORT";
2555+
break;
25532556
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP:
25542557
os << "UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP";
25552558
break;
@@ -4052,6 +4055,18 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info
40524055

40534056
os << ")";
40544057
} break;
4058+
case UR_DEVICE_INFO_USM_POOL_SUPPORT: {
4059+
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
4060+
if (sizeof(ur_bool_t) > size) {
4061+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")";
4062+
return UR_RESULT_ERROR_INVALID_SIZE;
4063+
}
4064+
os << (const void *)(tptr) << " (";
4065+
4066+
os << *tptr;
4067+
4068+
os << ")";
4069+
} break;
40554070
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: {
40564071
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
40574072
if (sizeof(ur_bool_t) > size) {

scripts/core/device.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ etors:
441441
desc: "[$x_device_handle_t] The composite device containing this component device."
442442
- name: GLOBAL_VARIABLE_SUPPORT
443443
desc: "[$x_bool_t] return true if the device supports the `EnqueueDeviceGlobalVariableWrite` and `EnqueueDeviceGlobalVariableRead` entry points."
444+
- name: USM_POOL_SUPPORT
445+
desc: "[$x_bool_t] return true if the device supports USM pooling. Pertains to the `USMPool` entry points and usage of the `pool` parameter of the USM alloc entry points."
444446
--- #--------------------------------------------------------------------------
445447
type: function
446448
desc: "Retrieves various information about device"

scripts/core/usm.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ class: $xUSM
229229
name: HostAlloc
230230
ordinal: "0"
231231
details:
232-
- "This function must support memory pooling."
233232
- "If pUSMDesc is not NULL and pUSMDesc->pool is not NULL the allocation will be served from a specified memory pool."
234233
- "Otherwise, the behavior is implementation-defined."
235234
- "Allocations served from different memory pools must be isolated and must not reside on the same page."
@@ -264,14 +263,15 @@ returns:
264263
- "`size` is greater than $X_DEVICE_INFO_MAX_MEM_ALLOC_SIZE."
265264
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
266265
- $X_RESULT_ERROR_OUT_OF_RESOURCES
266+
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
267+
- "If any device associated with `hContext` reports `false` for $X_DEVICE_INFO_USM_POOL_SUPPORT"
267268
--- #--------------------------------------------------------------------------
268269
type: function
269270
desc: "USM allocate device memory"
270271
class: $xUSM
271272
name: DeviceAlloc
272273
ordinal: "0"
273274
details:
274-
- "This function must support memory pooling."
275275
- "If pUSMDesc is not NULL and pUSMDesc->pool is not NULL the allocation will be served from a specified memory pool."
276276
- "Otherwise, the behavior is implementation-defined."
277277
- "Allocations served from different memory pools must be isolated and must not reside on the same page."
@@ -309,14 +309,15 @@ returns:
309309
- "`size` is greater than $X_DEVICE_INFO_MAX_MEM_ALLOC_SIZE."
310310
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
311311
- $X_RESULT_ERROR_OUT_OF_RESOURCES
312+
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
313+
- "If any device associated with `hContext` reports `false` for $X_DEVICE_INFO_USM_POOL_SUPPORT"
312314
--- #--------------------------------------------------------------------------
313315
type: function
314316
desc: "USM allocate shared memory"
315317
class: $xUSM
316318
name: SharedAlloc
317319
ordinal: "0"
318320
details:
319-
- "This function must support memory pooling."
320321
- "If pUSMDesc is not NULL and pUSMDesc->pool is not NULL the allocation will be served from a specified memory pool."
321322
- "Otherwise, the behavior is implementation-defined."
322323
- "Allocations served from different memory pools must be isolated and must not reside on the same page."
@@ -355,6 +356,8 @@ returns:
355356
- "If `UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT` and `UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT` are both false."
356357
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
357358
- $X_RESULT_ERROR_OUT_OF_RESOURCES
359+
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
360+
- "If any device associated with `hContext` reports `false` for $X_DEVICE_INFO_USM_POOL_SUPPORT"
358361
--- #--------------------------------------------------------------------------
359362
type: function
360363
desc: "Free the USM memory object"
@@ -424,6 +427,8 @@ returns:
424427
- $X_RESULT_ERROR_INVALID_NULL_HANDLE
425428
- $X_RESULT_ERROR_INVALID_VALUE
426429
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
430+
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
431+
- "If any device associated with `hContext` reports `false` for $X_DEVICE_INFO_USM_POOL_SUPPORT"
427432
--- #--------------------------------------------------------------------------
428433
type: function
429434
desc: "Get a reference to the pool handle. Increment its reference count"
@@ -436,6 +441,7 @@ params:
436441
desc: "[in][retain] pointer to USM memory pool"
437442
returns:
438443
- $X_RESULT_ERROR_INVALID_NULL_HANDLE
444+
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE
439445
--- #--------------------------------------------------------------------------
440446
type: function
441447
desc: "Decrement the pool's reference count and delete the pool if the reference count becomes zero."
@@ -452,6 +458,7 @@ params:
452458
desc: "[in][release] pointer to USM memory pool"
453459
returns:
454460
- $X_RESULT_ERROR_INVALID_NULL_HANDLE
461+
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE
455462
--- #--------------------------------------------------------------------------
456463
type: enum
457464
desc: "Get USM memory pool information"
@@ -499,3 +506,4 @@ returns:
499506
- "`pPropValue == NULL && pPropSizeRet == NULL`"
500507
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
501508
- $X_RESULT_ERROR_OUT_OF_RESOURCES
509+
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE

source/adapters/cuda/device.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
10761076
return ReturnValue(static_cast<ur_bool_t>(false));
10771077
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
10781078
return ReturnValue(static_cast<ur_bool_t>(true));
1079+
case UR_DEVICE_INFO_USM_POOL_SUPPORT:
1080+
return ReturnValue(static_cast<ur_bool_t>(true));
10791081
case UR_DEVICE_INFO_COMPONENT_DEVICES:
10801082
case UR_DEVICE_INFO_COMPOSITE_DEVICE:
10811083
case UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS:

source/adapters/hip/device.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
889889

890890
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
891891
return ReturnValue(ur_bool_t{false});
892+
case UR_DEVICE_INFO_USM_POOL_SUPPORT:
893+
return ReturnValue(ur_bool_t{true});
892894
// TODO: Investigate if this information is available on HIP.
893895
case UR_DEVICE_INFO_COMPONENT_DEVICES:
894896
case UR_DEVICE_INFO_COMPOSITE_DEVICE:

source/adapters/level_zero/device.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,8 @@ ur_result_t urDeviceGetInfo(
11491149
return ReturnValue(false);
11501150
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
11511151
return ReturnValue(true);
1152+
case UR_DEVICE_INFO_USM_POOL_SUPPORT:
1153+
return ReturnValue(true);
11521154
default:
11531155
logger::error("Unsupported ParamName in urGetDeviceInfo");
11541156
logger::error("ParamNameParamName={}(0x{})", ParamName,

source/adapters/native_cpu/device.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
414414
case UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP:
415415
return ReturnValue(false);
416416

417+
case UR_DEVICE_INFO_USM_POOL_SUPPORT:
418+
return ReturnValue(false);
419+
417420
default:
418421
DIE_NO_IMPLEMENTATION;
419422
}

source/adapters/opencl/device.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
10681068
case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS: {
10691069
return ReturnValue(false);
10701070
}
1071+
1072+
case UR_DEVICE_INFO_USM_POOL_SUPPORT: {
1073+
return ReturnValue(false);
1074+
}
1075+
10711076
/* TODO: Check regularly to see if support is enabled in OpenCL. Intel GPU
10721077
* EU device-specific information extensions. Some of the queries are
10731078
* enabled by cl_intel_device_attribute_query extension, but it's not yet in

source/adapters/opencl/ur_interface_loader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ urGetUSMProcAddrTable(ur_api_version_t Version, ur_usm_dditable_t *pDdiTable) {
238238
pDdiTable->pfnFree = urUSMFree;
239239
pDdiTable->pfnGetMemAllocInfo = urUSMGetMemAllocInfo;
240240
pDdiTable->pfnHostAlloc = urUSMHostAlloc;
241-
pDdiTable->pfnPoolCreate = nullptr;
242-
pDdiTable->pfnPoolRetain = nullptr;
243-
pDdiTable->pfnPoolRelease = nullptr;
244-
pDdiTable->pfnPoolGetInfo = nullptr;
241+
pDdiTable->pfnPoolCreate = urUSMPoolCreate;
242+
pDdiTable->pfnPoolRetain = urUSMPoolRetain;
243+
pDdiTable->pfnPoolRelease = urUSMPoolRelease;
244+
pDdiTable->pfnPoolGetInfo = urUSMPoolGetInfo;
245245
pDdiTable->pfnSharedAlloc = urUSMSharedAlloc;
246246
return UR_RESULT_SUCCESS;
247247
}

source/adapters/opencl/usm.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,3 +703,28 @@ urUSMReleaseExp([[maybe_unused]] ur_context_handle_t Context,
703703
[[maybe_unused]] void *HostPtr) {
704704
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
705705
}
706+
707+
UR_APIEXPORT ur_result_t UR_APICALL
708+
urUSMPoolCreate([[maybe_unused]] ur_context_handle_t hContext,
709+
[[maybe_unused]] ur_usm_pool_desc_t *pPoolDesc,
710+
[[maybe_unused]] ur_usm_pool_handle_t *ppPool) {
711+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
712+
}
713+
714+
UR_APIEXPORT ur_result_t UR_APICALL
715+
urUSMPoolRetain([[maybe_unused]] ur_usm_pool_handle_t pPool) {
716+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
717+
}
718+
719+
UR_APIEXPORT ur_result_t UR_APICALL
720+
urUSMPoolRelease([[maybe_unused]] ur_usm_pool_handle_t pPool) {
721+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
722+
}
723+
724+
UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolGetInfo(
725+
[[maybe_unused]] ur_usm_pool_handle_t hPool,
726+
[[maybe_unused]] ur_usm_pool_info_t propName,
727+
[[maybe_unused]] size_t propSize, [[maybe_unused]] void *pPropValue,
728+
[[maybe_unused]] size_t *pPropSizeRet) {
729+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
730+
}

source/loader/ur_libapi.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,6 @@ ur_result_t UR_APICALL urSamplerCreateWithNativeHandle(
22252225
/// @brief USM allocate host memory
22262226
///
22272227
/// @details
2228-
/// - This function must support memory pooling.
22292228
/// - If pUSMDesc is not NULL and pUSMDesc->pool is not NULL the allocation
22302229
/// will be served from a specified memory pool.
22312230
/// - Otherwise, the behavior is implementation-defined.
@@ -2258,6 +2257,8 @@ ur_result_t UR_APICALL urSamplerCreateWithNativeHandle(
22582257
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
22592258
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
22602259
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
2260+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
2261+
/// + If any device associated with `hContext` reports `false` for ::UR_DEVICE_INFO_USM_POOL_SUPPORT
22612262
ur_result_t UR_APICALL urUSMHostAlloc(
22622263
ur_context_handle_t hContext, ///< [in] handle of the context object
22632264
const ur_usm_desc_t
@@ -2282,7 +2283,6 @@ ur_result_t UR_APICALL urUSMHostAlloc(
22822283
/// @brief USM allocate device memory
22832284
///
22842285
/// @details
2285-
/// - This function must support memory pooling.
22862286
/// - If pUSMDesc is not NULL and pUSMDesc->pool is not NULL the allocation
22872287
/// will be served from a specified memory pool.
22882288
/// - Otherwise, the behavior is implementation-defined.
@@ -2316,6 +2316,8 @@ ur_result_t UR_APICALL urUSMHostAlloc(
23162316
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
23172317
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
23182318
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
2319+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
2320+
/// + If any device associated with `hContext` reports `false` for ::UR_DEVICE_INFO_USM_POOL_SUPPORT
23192321
ur_result_t UR_APICALL urUSMDeviceAlloc(
23202322
ur_context_handle_t hContext, ///< [in] handle of the context object
23212323
ur_device_handle_t hDevice, ///< [in] handle of the device object
@@ -2341,7 +2343,6 @@ ur_result_t UR_APICALL urUSMDeviceAlloc(
23412343
/// @brief USM allocate shared memory
23422344
///
23432345
/// @details
2344-
/// - This function must support memory pooling.
23452346
/// - If pUSMDesc is not NULL and pUSMDesc->pool is not NULL the allocation
23462347
/// will be served from a specified memory pool.
23472348
/// - Otherwise, the behavior is implementation-defined.
@@ -2376,6 +2377,8 @@ ur_result_t UR_APICALL urUSMDeviceAlloc(
23762377
/// + If `UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT` and `UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT` are both false.
23772378
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
23782379
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
2380+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
2381+
/// + If any device associated with `hContext` reports `false` for ::UR_DEVICE_INFO_USM_POOL_SUPPORT
23792382
ur_result_t UR_APICALL urUSMSharedAlloc(
23802383
ur_context_handle_t hContext, ///< [in] handle of the context object
23812384
ur_device_handle_t hDevice, ///< [in] handle of the device object
@@ -2490,6 +2493,8 @@ ur_result_t UR_APICALL urUSMGetMemAllocInfo(
24902493
/// + `::UR_USM_POOL_FLAGS_MASK & pPoolDesc->flags`
24912494
/// - ::UR_RESULT_ERROR_INVALID_VALUE
24922495
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
2496+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
2497+
/// + If any device associated with `hContext` reports `false` for ::UR_DEVICE_INFO_USM_POOL_SUPPORT
24932498
ur_result_t UR_APICALL urUSMPoolCreate(
24942499
ur_context_handle_t hContext, ///< [in] handle of the context object
24952500
ur_usm_pool_desc_t *
@@ -2517,6 +2522,7 @@ ur_result_t UR_APICALL urUSMPoolCreate(
25172522
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
25182523
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
25192524
/// + `NULL == pPool`
2525+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
25202526
ur_result_t UR_APICALL urUSMPoolRetain(
25212527
ur_usm_pool_handle_t pPool ///< [in][retain] pointer to USM memory pool
25222528
) try {
@@ -2547,6 +2553,7 @@ ur_result_t UR_APICALL urUSMPoolRetain(
25472553
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
25482554
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
25492555
/// + `NULL == pPool`
2556+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
25502557
ur_result_t UR_APICALL urUSMPoolRelease(
25512558
ur_usm_pool_handle_t pPool ///< [in][release] pointer to USM memory pool
25522559
) try {
@@ -2582,6 +2589,7 @@ ur_result_t UR_APICALL urUSMPoolRelease(
25822589
/// + `pPropValue == NULL && pPropSizeRet == NULL`
25832590
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
25842591
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
2592+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
25852593
ur_result_t UR_APICALL urUSMPoolGetInfo(
25862594
ur_usm_pool_handle_t hPool, ///< [in] handle of the USM memory pool
25872595
ur_usm_pool_info_t propName, ///< [in] name of the pool property to query

0 commit comments

Comments
 (0)