@@ -230,6 +230,10 @@ typedef enum ur_function_t {
230
230
UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP = 243, ///< Enumerator for ::urCommandBufferUpdateSignalEventExp
231
231
UR_FUNCTION_COMMAND_BUFFER_UPDATE_WAIT_EVENTS_EXP = 244, ///< Enumerator for ::urCommandBufferUpdateWaitEventsExp
232
232
UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP = 245, ///< Enumerator for ::urBindlessImagesMapExternalLinearMemoryExp
233
+ UR_FUNCTION_ENQUEUE_USM_DEVICE_ALLOC_EXP = 246, ///< Enumerator for ::urEnqueueUSMDeviceAllocExp
234
+ UR_FUNCTION_ENQUEUE_USM_SHARED_ALLOC_EXP = 247, ///< Enumerator for ::urEnqueueUSMSharedAllocExp
235
+ UR_FUNCTION_ENQUEUE_USM_HOST_ALLOC_EXP = 248, ///< Enumerator for ::urEnqueueUSMHostAllocExp
236
+ UR_FUNCTION_ENQUEUE_USM_FREE_EXP = 249, ///< Enumerator for ::urEnqueueUSMFreeExp
233
237
/// @cond
234
238
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
235
239
/// @endcond
@@ -288,6 +292,7 @@ typedef enum ur_structure_type_t {
288
292
UR_STRUCTURE_TYPE_EXP_SAMPLER_CUBEMAP_PROPERTIES = 0x2006, ///< ::ur_exp_sampler_cubemap_properties_t
289
293
UR_STRUCTURE_TYPE_EXP_IMAGE_COPY_REGION = 0x2007, ///< ::ur_exp_image_copy_region_t
290
294
UR_STRUCTURE_TYPE_EXP_ENQUEUE_NATIVE_COMMAND_PROPERTIES = 0x3000, ///< ::ur_exp_enqueue_native_command_properties_t
295
+ UR_STRUCTURE_TYPE_EXP_ENQUEUE_USM_ALLOC_PROPERTIES = 0x3001, ///< ::ur_exp_async_usm_alloc_properties_t
291
296
/// @cond
292
297
UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff
293
298
/// @endcond
@@ -1697,6 +1702,8 @@ typedef enum ur_device_info_t {
1697
1702
///< backed 2D sampled image data.
1698
1703
UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP = 0x2020, ///< [::ur_bool_t] returns true if the device supports enqueueing of native
1699
1704
///< work
1705
+ UR_DEVICE_INFO_ASYNC_USM_ALLOCATIONS_EXP = 0x2021, ///< [::ur_bool_t] returns true if the device supports enqueueing of native
1706
+ ///< work
1700
1707
/// @cond
1701
1708
UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff
1702
1709
/// @endcond
@@ -1722,7 +1729,7 @@ typedef enum ur_device_info_t {
1722
1729
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
1723
1730
/// + `NULL == hDevice`
1724
1731
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
1725
- /// + `::UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP < propName`
1732
+ /// + `::UR_DEVICE_INFO_ASYNC_USM_ALLOCATIONS_EXP < propName`
1726
1733
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
1727
1734
/// + If `propName` is not supported by the adapter.
1728
1735
/// - ::UR_RESULT_ERROR_INVALID_SIZE
@@ -5776,6 +5783,10 @@ typedef enum ur_command_t {
5776
5783
UR_COMMAND_EXTERNAL_SEMAPHORE_SIGNAL_EXP = 0x2001, ///< Event created by ::urBindlessImagesSignalExternalSemaphoreExp
5777
5784
UR_COMMAND_TIMESTAMP_RECORDING_EXP = 0x2002, ///< Event created by ::urEnqueueTimestampRecordingExp
5778
5785
UR_COMMAND_ENQUEUE_NATIVE_EXP = 0x2004, ///< Event created by ::urEnqueueNativeCommandExp
5786
+ UR_COMMAND_ENQUEUE_USM_DEVICE_ALLOC_EXP = 0x2008, ///< Event created by ::urEnqueueDeviceAllocExp
5787
+ UR_COMMAND_ENQUEUE_USM_SHARED_ALLOC_EXP = 0x2010, ///< Event created by ::urEnqueueSharedAllocExp
5788
+ UR_COMMAND_ENQUEUE_USM_HOST_ALLOC_EXP = 0x2011, ///< Event created by ::urEnqueueHostAllocExp
5789
+ UR_COMMAND_ENQUEUE_USM_FREE_EXP = 0x2012, ///< Event created by ::urEnqueueFreeExp
5779
5790
/// @cond
5780
5791
UR_COMMAND_FORCE_UINT32 = 0x7fffffff
5781
5792
/// @endcond
@@ -7403,6 +7414,154 @@ urEnqueueWriteHostPipe(
7403
7414
///< an element of the phEventWaitList array.
7404
7415
);
7405
7416
7417
+ #if !defined(__GNUC__)
7418
+ #pragma endregion
7419
+ #endif
7420
+ // Intel 'oneAPI' Unified Runtime Experimental API for asynchronous allocations
7421
+ #if !defined(__GNUC__)
7422
+ #pragma region async_alloc_(experimental)
7423
+ #endif
7424
+ ///////////////////////////////////////////////////////////////////////////////
7425
+ /// @brief Async alloc properties
7426
+ typedef uint32_t ur_exp_async_usm_alloc_flags_t;
7427
+ typedef enum ur_exp_async_usm_alloc_flag_t {
7428
+ UR_EXP_ASYNC_USM_ALLOC_FLAG_TBD = UR_BIT(0), ///< reserved for future use.
7429
+ /// @cond
7430
+ UR_EXP_ASYNC_USM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff
7431
+ /// @endcond
7432
+
7433
+ } ur_exp_async_usm_alloc_flag_t;
7434
+ /// @brief Bit Mask for validating ur_exp_async_usm_alloc_flags_t
7435
+ #define UR_EXP_ASYNC_USM_ALLOC_FLAGS_MASK 0xfffffffe
7436
+
7437
+ ///////////////////////////////////////////////////////////////////////////////
7438
+ /// @brief Async alloc properties
7439
+ typedef struct ur_exp_async_usm_alloc_properties_t {
7440
+ ur_structure_type_t stype; ///< [in] type of this structure, must be
7441
+ ///< ::UR_STRUCTURE_TYPE_EXP_ASYNC_USM_ALLOC_PROPERTIES
7442
+ void *pNext; ///< [in,out][optional] pointer to extension-specific structure
7443
+ ur_exp_async_usm_alloc_flags_t flags; ///< [in] async alloc flags
7444
+
7445
+ } ur_exp_async_usm_alloc_properties_t;
7446
+
7447
+ ///////////////////////////////////////////////////////////////////////////////
7448
+ /// @brief Enqueue an async device allocation
7449
+ ///
7450
+ /// @returns
7451
+ /// - ::UR_RESULT_SUCCESS
7452
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
7453
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
7454
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
7455
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
7456
+ /// + `NULL == hQueue`
7457
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
7458
+ /// + `NULL != pProperties && ::UR_EXP_ASYNC_USM_ALLOC_FLAGS_MASK & pProperties->flags`
7459
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
7460
+ /// + `NULL == ppMem`
7461
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
7462
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
7463
+ UR_APIEXPORT ur_result_t UR_APICALL
7464
+ urEnqueueUSMDeviceAllocExp(
7465
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
7466
+ ur_usm_pool_handle_t pPool, ///< [in][optional] USM pool descriptor
7467
+ const size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
7468
+ const ur_exp_async_usm_alloc_properties_t *pProperties, ///< [in][optional] pointer to the enqueue async alloc properties
7469
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
7470
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
7471
+ ///< events that must be complete before the kernel execution.
7472
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
7473
+ void **ppMem, ///< [out] pointer to USM memory object
7474
+ ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies the async alloc
7475
+ );
7476
+
7477
+ ///////////////////////////////////////////////////////////////////////////////
7478
+ /// @brief Enqueue an async shared allocation
7479
+ ///
7480
+ /// @returns
7481
+ /// - ::UR_RESULT_SUCCESS
7482
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
7483
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
7484
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
7485
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
7486
+ /// + `NULL == hQueue`
7487
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
7488
+ /// + `NULL != pProperties && ::UR_EXP_ASYNC_USM_ALLOC_FLAGS_MASK & pProperties->flags`
7489
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
7490
+ /// + `NULL == ppMem`
7491
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
7492
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
7493
+ UR_APIEXPORT ur_result_t UR_APICALL
7494
+ urEnqueueUSMSharedAllocExp(
7495
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
7496
+ ur_usm_pool_handle_t pPool, ///< [in][optional] USM pool descriptor
7497
+ const size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
7498
+ const ur_exp_async_usm_alloc_properties_t *pProperties, ///< [in][optional] pointer to the enqueue async alloc properties
7499
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
7500
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
7501
+ ///< events that must be complete before the kernel execution.
7502
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
7503
+ void **ppMem, ///< [out] pointer to USM memory object
7504
+ ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies the async alloc
7505
+ );
7506
+
7507
+ ///////////////////////////////////////////////////////////////////////////////
7508
+ /// @brief Enqueue an async host allocation
7509
+ ///
7510
+ /// @returns
7511
+ /// - ::UR_RESULT_SUCCESS
7512
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
7513
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
7514
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
7515
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
7516
+ /// + `NULL == hQueue`
7517
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
7518
+ /// + `NULL != pProperties && ::UR_EXP_ASYNC_USM_ALLOC_FLAGS_MASK & pProperties->flags`
7519
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
7520
+ /// + `NULL == ppMem`
7521
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
7522
+ /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
7523
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
7524
+ UR_APIEXPORT ur_result_t UR_APICALL
7525
+ urEnqueueUSMHostAllocExp(
7526
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
7527
+ ur_usm_pool_handle_t pPool, ///< [in][optional] USM pool descriptor
7528
+ const size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
7529
+ const ur_exp_async_usm_alloc_properties_t *pProperties, ///< [in][optional] pointer to the enqueue async alloc properties
7530
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
7531
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
7532
+ ///< events that must be complete before the kernel execution.
7533
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
7534
+ void **ppMem, ///< [out] pointer to USM memory object
7535
+ ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies the async alloc
7536
+ );
7537
+
7538
+ ///////////////////////////////////////////////////////////////////////////////
7539
+ /// @brief Enqueue an async host allocation
7540
+ ///
7541
+ /// @returns
7542
+ /// - ::UR_RESULT_SUCCESS
7543
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
7544
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
7545
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
7546
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
7547
+ /// + `NULL == hQueue`
7548
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
7549
+ /// + `NULL == pMem`
7550
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
7551
+ /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
7552
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
7553
+ UR_APIEXPORT ur_result_t UR_APICALL
7554
+ urEnqueueUSMFreeExp(
7555
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
7556
+ ur_usm_pool_handle_t pPool, ///< [in][optional] USM pool descriptor
7557
+ void *pMem, ///< [in] pointer to USM memory object
7558
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
7559
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
7560
+ ///< events that must be complete before the kernel execution.
7561
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
7562
+ ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies the async alloc
7563
+ );
7564
+
7406
7565
#if !defined(__GNUC__)
7407
7566
#pragma endregion
7408
7567
#endif
@@ -11432,6 +11591,64 @@ typedef struct ur_enqueue_kernel_launch_custom_exp_params_t {
11432
11591
ur_event_handle_t **pphEvent;
11433
11592
} ur_enqueue_kernel_launch_custom_exp_params_t;
11434
11593
11594
+ ///////////////////////////////////////////////////////////////////////////////
11595
+ /// @brief Function parameters for urEnqueueUSMDeviceAllocExp
11596
+ /// @details Each entry is a pointer to the parameter passed to the function;
11597
+ /// allowing the callback the ability to modify the parameter's value
11598
+ typedef struct ur_enqueue_usm_device_alloc_exp_params_t {
11599
+ ur_queue_handle_t *phQueue;
11600
+ ur_usm_pool_handle_t *ppPool;
11601
+ const size_t *psize;
11602
+ const ur_exp_async_usm_alloc_properties_t **ppProperties;
11603
+ uint32_t *pnumEventsInWaitList;
11604
+ const ur_event_handle_t **pphEventWaitList;
11605
+ void ***pppMem;
11606
+ ur_event_handle_t **pphEvent;
11607
+ } ur_enqueue_usm_device_alloc_exp_params_t;
11608
+
11609
+ ///////////////////////////////////////////////////////////////////////////////
11610
+ /// @brief Function parameters for urEnqueueUSMSharedAllocExp
11611
+ /// @details Each entry is a pointer to the parameter passed to the function;
11612
+ /// allowing the callback the ability to modify the parameter's value
11613
+ typedef struct ur_enqueue_usm_shared_alloc_exp_params_t {
11614
+ ur_queue_handle_t *phQueue;
11615
+ ur_usm_pool_handle_t *ppPool;
11616
+ const size_t *psize;
11617
+ const ur_exp_async_usm_alloc_properties_t **ppProperties;
11618
+ uint32_t *pnumEventsInWaitList;
11619
+ const ur_event_handle_t **pphEventWaitList;
11620
+ void ***pppMem;
11621
+ ur_event_handle_t **pphEvent;
11622
+ } ur_enqueue_usm_shared_alloc_exp_params_t;
11623
+
11624
+ ///////////////////////////////////////////////////////////////////////////////
11625
+ /// @brief Function parameters for urEnqueueUSMHostAllocExp
11626
+ /// @details Each entry is a pointer to the parameter passed to the function;
11627
+ /// allowing the callback the ability to modify the parameter's value
11628
+ typedef struct ur_enqueue_usm_host_alloc_exp_params_t {
11629
+ ur_queue_handle_t *phQueue;
11630
+ ur_usm_pool_handle_t *ppPool;
11631
+ const size_t *psize;
11632
+ const ur_exp_async_usm_alloc_properties_t **ppProperties;
11633
+ uint32_t *pnumEventsInWaitList;
11634
+ const ur_event_handle_t **pphEventWaitList;
11635
+ void ***pppMem;
11636
+ ur_event_handle_t **pphEvent;
11637
+ } ur_enqueue_usm_host_alloc_exp_params_t;
11638
+
11639
+ ///////////////////////////////////////////////////////////////////////////////
11640
+ /// @brief Function parameters for urEnqueueUSMFreeExp
11641
+ /// @details Each entry is a pointer to the parameter passed to the function;
11642
+ /// allowing the callback the ability to modify the parameter's value
11643
+ typedef struct ur_enqueue_usm_free_exp_params_t {
11644
+ ur_queue_handle_t *phQueue;
11645
+ ur_usm_pool_handle_t *ppPool;
11646
+ void **ppMem;
11647
+ uint32_t *pnumEventsInWaitList;
11648
+ const ur_event_handle_t **pphEventWaitList;
11649
+ ur_event_handle_t **pphEvent;
11650
+ } ur_enqueue_usm_free_exp_params_t;
11651
+
11435
11652
///////////////////////////////////////////////////////////////////////////////
11436
11653
/// @brief Function parameters for urEnqueueCooperativeKernelLaunchExp
11437
11654
/// @details Each entry is a pointer to the parameter passed to the function;
0 commit comments