@@ -429,6 +429,14 @@ typedef enum ur_function_t {
429
429
UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT = 246,
430
430
/// Enumerator for ::urPhysicalMemGetInfo
431
431
UR_FUNCTION_PHYSICAL_MEM_GET_INFO = 249,
432
+ /// Enumerator for ::urEnqueueUSMDeviceAllocExp
433
+ UR_FUNCTION_ENQUEUE_USM_DEVICE_ALLOC_EXP = 250,
434
+ /// Enumerator for ::urEnqueueUSMSharedAllocExp
435
+ UR_FUNCTION_ENQUEUE_USM_SHARED_ALLOC_EXP = 251,
436
+ /// Enumerator for ::urEnqueueUSMHostAllocExp
437
+ UR_FUNCTION_ENQUEUE_USM_HOST_ALLOC_EXP = 252,
438
+ /// Enumerator for ::urEnqueueUSMFreeExp
439
+ UR_FUNCTION_ENQUEUE_USM_FREE_EXP = 253,
432
440
/// @cond
433
441
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
434
442
/// @endcond
@@ -536,6 +544,8 @@ typedef enum ur_structure_type_t {
536
544
UR_STRUCTURE_TYPE_EXP_IMAGE_COPY_REGION = 0x2007,
537
545
/// ::ur_exp_enqueue_native_command_properties_t
538
546
UR_STRUCTURE_TYPE_EXP_ENQUEUE_NATIVE_COMMAND_PROPERTIES = 0x3000,
547
+ /// ::ur_exp_enqueue_usm_alloc_properties_t
548
+ UR_STRUCTURE_TYPE_EXP_ENQUEUE_USM_ALLOC_PROPERTIES = 0x3001,
539
549
/// ::ur_exp_enqueue_ext_properties_t
540
550
UR_STRUCTURE_TYPE_EXP_ENQUEUE_EXT_PROPERTIES = 0x4000,
541
551
/// @cond
@@ -2289,6 +2299,9 @@ typedef enum ur_device_info_t {
2289
2299
/// [::ur_exp_device_2d_block_array_capability_flags_t] return a bit-field
2290
2300
/// of Intel GPU 2D block array capabilities
2291
2301
UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP = 0x2022,
2302
+ /// [::ur_bool_t] returns true if the device supports USM allocation
2303
+ /// enqueueing
2304
+ UR_DEVICE_INFO_ENQUEUE_USM_ALLOCATIONS_EXP = 0x2023,
2292
2305
/// @cond
2293
2306
UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff
2294
2307
/// @endcond
@@ -2314,7 +2327,7 @@ typedef enum ur_device_info_t {
2314
2327
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
2315
2328
/// + `NULL == hDevice`
2316
2329
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
2317
- /// + `::UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP < propName`
2330
+ /// + `::UR_DEVICE_INFO_ENQUEUE_USM_ALLOCATIONS_EXP < propName`
2318
2331
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
2319
2332
/// + If `propName` is not supported by the adapter.
2320
2333
/// - ::UR_RESULT_ERROR_INVALID_SIZE
@@ -7047,6 +7060,14 @@ typedef enum ur_command_t {
7047
7060
UR_COMMAND_TIMESTAMP_RECORDING_EXP = 0x2002,
7048
7061
/// Event created by ::urEnqueueNativeCommandExp
7049
7062
UR_COMMAND_ENQUEUE_NATIVE_EXP = 0x2004,
7063
+ /// Event created by ::urEnqueueUSMDeviceAllocExp
7064
+ UR_COMMAND_ENQUEUE_USM_DEVICE_ALLOC_EXP = 0x2005,
7065
+ /// Event created by ::urEnqueueUSMSharedAllocExp
7066
+ UR_COMMAND_ENQUEUE_USM_SHARED_ALLOC_EXP = 0x2006,
7067
+ /// Event created by ::urEnqueueUSMHostAllocExp
7068
+ UR_COMMAND_ENQUEUE_USM_HOST_ALLOC_EXP = 0x2007,
7069
+ /// Event created by ::urEnqueueUSMFreeExp
7070
+ UR_COMMAND_ENQUEUE_USM_FREE_EXP = 0x2008,
7050
7071
/// @cond
7051
7072
UR_COMMAND_FORCE_UINT32 = 0x7fffffff
7052
7073
/// @endcond
@@ -8941,6 +8962,195 @@ typedef enum ur_exp_device_2d_block_array_capability_flag_t {
8941
8962
/// ur_exp_device_2d_block_array_capability_flags_t
8942
8963
#define UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAGS_MASK 0xfffffffc
8943
8964
8965
+ #if !defined(__GNUC__)
8966
+ #pragma endregion
8967
+ #endif
8968
+ // Intel 'oneAPI' Unified Runtime Experimental API for enqueuing asynchronous
8969
+ // USM allocations
8970
+ #if !defined(__GNUC__)
8971
+ #pragma region async_alloc_(experimental)
8972
+ #endif
8973
+ ///////////////////////////////////////////////////////////////////////////////
8974
+ /// @brief Enqueue USM allocation flags
8975
+ typedef uint32_t ur_exp_enqueue_usm_alloc_flags_t;
8976
+ typedef enum ur_exp_enqueue_usm_alloc_flag_t {
8977
+ /// reserved for future use.
8978
+ UR_EXP_ENQUEUE_USM_ALLOC_FLAG_TBD = UR_BIT(0),
8979
+ /// @cond
8980
+ UR_EXP_ENQUEUE_USM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff
8981
+ /// @endcond
8982
+
8983
+ } ur_exp_enqueue_usm_alloc_flag_t;
8984
+ /// @brief Bit Mask for validating ur_exp_enqueue_usm_alloc_flags_t
8985
+ #define UR_EXP_ENQUEUE_USM_ALLOC_FLAGS_MASK 0xfffffffe
8986
+
8987
+ ///////////////////////////////////////////////////////////////////////////////
8988
+ /// @brief Enqueue USM allocation properties
8989
+ typedef struct ur_exp_enqueue_usm_alloc_properties_t {
8990
+ /// [in] type of this structure, must be
8991
+ /// ::UR_STRUCTURE_TYPE_EXP_ENQUEUE_USM_ALLOC_PROPERTIES
8992
+ ur_structure_type_t stype;
8993
+ /// [in,out][optional] pointer to extension-specific structure
8994
+ void *pNext;
8995
+ /// [in] enqueue USM allocation flags
8996
+ ur_exp_enqueue_usm_alloc_flags_t flags;
8997
+
8998
+ } ur_exp_enqueue_usm_alloc_properties_t;
8999
+
9000
+ ///////////////////////////////////////////////////////////////////////////////
9001
+ /// @brief Enqueue an asynchronous USM device allocation
9002
+ ///
9003
+ /// @returns
9004
+ /// - ::UR_RESULT_SUCCESS
9005
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
9006
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
9007
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9008
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9009
+ /// + `NULL == hQueue`
9010
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
9011
+ /// + `NULL != pProperties && ::UR_EXP_ENQUEUE_USM_ALLOC_FLAGS_MASK &
9012
+ /// pProperties->flags`
9013
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9014
+ /// + `NULL == ppMem`
9015
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
9016
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
9017
+ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp(
9018
+ /// [in] handle of the queue object
9019
+ ur_queue_handle_t hQueue,
9020
+ /// [in][optional] handle of the USM memory pool
9021
+ ur_usm_pool_handle_t pPool,
9022
+ /// [in] minimum size in bytes of the USM memory object to be allocated
9023
+ const size_t size,
9024
+ /// [in][optional] pointer to the enqueue asynchronous USM allocation
9025
+ /// properties
9026
+ const ur_exp_enqueue_usm_alloc_properties_t *pProperties,
9027
+ /// [in] size of the event wait list
9028
+ uint32_t numEventsInWaitList,
9029
+ /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of
9030
+ /// events that must be complete before the kernel execution.
9031
+ /// If nullptr, the numEventsInWaitList must be 0, indicating no wait
9032
+ /// events.
9033
+ const ur_event_handle_t *phEventWaitList,
9034
+ /// [out] pointer to USM memory object
9035
+ void **ppMem,
9036
+ /// [out][optional] return an event object that identifies the
9037
+ /// asynchronous USM device allocation
9038
+ ur_event_handle_t *phEvent);
9039
+
9040
+ ///////////////////////////////////////////////////////////////////////////////
9041
+ /// @brief Enqueue an asynchronous USM shared allocation
9042
+ ///
9043
+ /// @returns
9044
+ /// - ::UR_RESULT_SUCCESS
9045
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
9046
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
9047
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9048
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9049
+ /// + `NULL == hQueue`
9050
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
9051
+ /// + `NULL != pProperties && ::UR_EXP_ENQUEUE_USM_ALLOC_FLAGS_MASK &
9052
+ /// pProperties->flags`
9053
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9054
+ /// + `NULL == ppMem`
9055
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
9056
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
9057
+ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp(
9058
+ /// [in] handle of the queue object
9059
+ ur_queue_handle_t hQueue,
9060
+ /// [in][optional] handle of the USM memory pool
9061
+ ur_usm_pool_handle_t pPool,
9062
+ /// [in] minimum size in bytes of the USM memory object to be allocated
9063
+ const size_t size,
9064
+ /// [in][optional] pointer to the enqueue asynchronous USM allocation
9065
+ /// properties
9066
+ const ur_exp_enqueue_usm_alloc_properties_t *pProperties,
9067
+ /// [in] size of the event wait list
9068
+ uint32_t numEventsInWaitList,
9069
+ /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of
9070
+ /// events that must be complete before the kernel execution.
9071
+ /// If nullptr, the numEventsInWaitList must be 0, indicating no wait
9072
+ /// events.
9073
+ const ur_event_handle_t *phEventWaitList,
9074
+ /// [out] pointer to USM memory object
9075
+ void **ppMem,
9076
+ /// [out][optional] return an event object that identifies the
9077
+ /// asynchronous USM shared allocation
9078
+ ur_event_handle_t *phEvent);
9079
+
9080
+ ///////////////////////////////////////////////////////////////////////////////
9081
+ /// @brief Enqueue an asynchronous USM host allocation
9082
+ ///
9083
+ /// @returns
9084
+ /// - ::UR_RESULT_SUCCESS
9085
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
9086
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
9087
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9088
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9089
+ /// + `NULL == hQueue`
9090
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
9091
+ /// + `NULL != pProperties && ::UR_EXP_ENQUEUE_USM_ALLOC_FLAGS_MASK &
9092
+ /// pProperties->flags`
9093
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9094
+ /// + `NULL == ppMem`
9095
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
9096
+ /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
9097
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
9098
+ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMHostAllocExp(
9099
+ /// [in] handle of the queue object
9100
+ ur_queue_handle_t hQueue,
9101
+ /// [in][optional] handle of the USM memory pool
9102
+ ur_usm_pool_handle_t pPool,
9103
+ /// [in] minimum size in bytes of the USM memory object to be allocated
9104
+ const size_t size,
9105
+ /// [in][optional] pointer to the enqueue asynchronous USM allocation
9106
+ /// properties
9107
+ const ur_exp_enqueue_usm_alloc_properties_t *pProperties,
9108
+ /// [in] size of the event wait list
9109
+ uint32_t numEventsInWaitList,
9110
+ /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of
9111
+ /// events that must be complete before the kernel execution.
9112
+ /// If nullptr, the numEventsInWaitList must be 0, indicating no wait
9113
+ /// events.
9114
+ const ur_event_handle_t *phEventWaitList,
9115
+ /// [out] pointer to USM memory object
9116
+ void **ppMem,
9117
+ /// [out][optional] return an event object that identifies the
9118
+ /// asynchronous USM host allocation
9119
+ ur_event_handle_t *phEvent);
9120
+
9121
+ ///////////////////////////////////////////////////////////////////////////////
9122
+ /// @brief Enqueue an asynchronous USM deallocation
9123
+ ///
9124
+ /// @returns
9125
+ /// - ::UR_RESULT_SUCCESS
9126
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
9127
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
9128
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9129
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9130
+ /// + `NULL == hQueue`
9131
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9132
+ /// + `NULL == pMem`
9133
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
9134
+ /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
9135
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
9136
+ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFreeExp(
9137
+ /// [in] handle of the queue object
9138
+ ur_queue_handle_t hQueue,
9139
+ /// [in][optional] handle of the USM memory pool
9140
+ ur_usm_pool_handle_t pPool,
9141
+ /// [in] pointer to USM memory object
9142
+ void *pMem,
9143
+ /// [in] size of the event wait list
9144
+ uint32_t numEventsInWaitList,
9145
+ /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of
9146
+ /// events that must be complete before the kernel execution.
9147
+ /// If nullptr, the numEventsInWaitList must be 0, indicating no wait
9148
+ /// events.
9149
+ const ur_event_handle_t *phEventWaitList,
9150
+ /// [out][optional] return an event object that identifies the
9151
+ /// asynchronous USM deallocation
9152
+ ur_event_handle_t *phEvent);
9153
+
8944
9154
#if !defined(__GNUC__)
8945
9155
#pragma endregion
8946
9156
#endif
@@ -13486,6 +13696,64 @@ typedef struct ur_enqueue_events_wait_with_barrier_ext_params_t {
13486
13696
ur_event_handle_t **pphEvent;
13487
13697
} ur_enqueue_events_wait_with_barrier_ext_params_t;
13488
13698
13699
+ ///////////////////////////////////////////////////////////////////////////////
13700
+ /// @brief Function parameters for urEnqueueUSMDeviceAllocExp
13701
+ /// @details Each entry is a pointer to the parameter passed to the function;
13702
+ /// allowing the callback the ability to modify the parameter's value
13703
+ typedef struct ur_enqueue_usm_device_alloc_exp_params_t {
13704
+ ur_queue_handle_t *phQueue;
13705
+ ur_usm_pool_handle_t *ppPool;
13706
+ const size_t *psize;
13707
+ const ur_exp_enqueue_usm_alloc_properties_t **ppProperties;
13708
+ uint32_t *pnumEventsInWaitList;
13709
+ const ur_event_handle_t **pphEventWaitList;
13710
+ void ***pppMem;
13711
+ ur_event_handle_t **pphEvent;
13712
+ } ur_enqueue_usm_device_alloc_exp_params_t;
13713
+
13714
+ ///////////////////////////////////////////////////////////////////////////////
13715
+ /// @brief Function parameters for urEnqueueUSMSharedAllocExp
13716
+ /// @details Each entry is a pointer to the parameter passed to the function;
13717
+ /// allowing the callback the ability to modify the parameter's value
13718
+ typedef struct ur_enqueue_usm_shared_alloc_exp_params_t {
13719
+ ur_queue_handle_t *phQueue;
13720
+ ur_usm_pool_handle_t *ppPool;
13721
+ const size_t *psize;
13722
+ const ur_exp_enqueue_usm_alloc_properties_t **ppProperties;
13723
+ uint32_t *pnumEventsInWaitList;
13724
+ const ur_event_handle_t **pphEventWaitList;
13725
+ void ***pppMem;
13726
+ ur_event_handle_t **pphEvent;
13727
+ } ur_enqueue_usm_shared_alloc_exp_params_t;
13728
+
13729
+ ///////////////////////////////////////////////////////////////////////////////
13730
+ /// @brief Function parameters for urEnqueueUSMHostAllocExp
13731
+ /// @details Each entry is a pointer to the parameter passed to the function;
13732
+ /// allowing the callback the ability to modify the parameter's value
13733
+ typedef struct ur_enqueue_usm_host_alloc_exp_params_t {
13734
+ ur_queue_handle_t *phQueue;
13735
+ ur_usm_pool_handle_t *ppPool;
13736
+ const size_t *psize;
13737
+ const ur_exp_enqueue_usm_alloc_properties_t **ppProperties;
13738
+ uint32_t *pnumEventsInWaitList;
13739
+ const ur_event_handle_t **pphEventWaitList;
13740
+ void ***pppMem;
13741
+ ur_event_handle_t **pphEvent;
13742
+ } ur_enqueue_usm_host_alloc_exp_params_t;
13743
+
13744
+ ///////////////////////////////////////////////////////////////////////////////
13745
+ /// @brief Function parameters for urEnqueueUSMFreeExp
13746
+ /// @details Each entry is a pointer to the parameter passed to the function;
13747
+ /// allowing the callback the ability to modify the parameter's value
13748
+ typedef struct ur_enqueue_usm_free_exp_params_t {
13749
+ ur_queue_handle_t *phQueue;
13750
+ ur_usm_pool_handle_t *ppPool;
13751
+ void **ppMem;
13752
+ uint32_t *pnumEventsInWaitList;
13753
+ const ur_event_handle_t **pphEventWaitList;
13754
+ ur_event_handle_t **pphEvent;
13755
+ } ur_enqueue_usm_free_exp_params_t;
13756
+
13489
13757
///////////////////////////////////////////////////////////////////////////////
13490
13758
/// @brief Function parameters for urEnqueueCooperativeKernelLaunchExp
13491
13759
/// @details Each entry is a pointer to the parameter passed to the function;
0 commit comments