@@ -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
@@ -5768,6 +5775,10 @@ typedef enum ur_command_t {
5768
5775
UR_COMMAND_EXTERNAL_SEMAPHORE_SIGNAL_EXP = 0x2001, ///< Event created by ::urBindlessImagesSignalExternalSemaphoreExp
5769
5776
UR_COMMAND_TIMESTAMP_RECORDING_EXP = 0x2002, ///< Event created by ::urEnqueueTimestampRecordingExp
5770
5777
UR_COMMAND_ENQUEUE_NATIVE_EXP = 0x2004, ///< Event created by ::urEnqueueNativeCommandExp
5778
+ UR_COMMAND_ENQUEUE_USM_DEVICE_ALLOC_EXP = 0x2008, ///< Event created by ::urEnqueueDeviceAllocExp
5779
+ UR_COMMAND_ENQUEUE_USM_SHARED_ALLOC_EXP = 0x2010, ///< Event created by ::urEnqueueSharedAllocExp
5780
+ UR_COMMAND_ENQUEUE_USM_HOST_ALLOC_EXP = 0x2011, ///< Event created by ::urEnqueueHostAllocExp
5781
+ UR_COMMAND_ENQUEUE_USM_FREE_EXP = 0x2012, ///< Event created by ::urEnqueueFreeExp
5771
5782
/// @cond
5772
5783
UR_COMMAND_FORCE_UINT32 = 0x7fffffff
5773
5784
/// @endcond
@@ -7395,6 +7406,154 @@ urEnqueueWriteHostPipe(
7395
7406
///< an element of the phEventWaitList array.
7396
7407
);
7397
7408
7409
+ #if !defined(__GNUC__)
7410
+ #pragma endregion
7411
+ #endif
7412
+ // Intel 'oneAPI' Unified Runtime Experimental API for asynchronous allocations
7413
+ #if !defined(__GNUC__)
7414
+ #pragma region async_alloc_(experimental)
7415
+ #endif
7416
+ ///////////////////////////////////////////////////////////////////////////////
7417
+ /// @brief Async alloc properties
7418
+ typedef uint32_t ur_exp_async_usm_alloc_flags_t;
7419
+ typedef enum ur_exp_async_usm_alloc_flag_t {
7420
+ UR_EXP_ASYNC_USM_ALLOC_FLAG_TBD = UR_BIT(0), ///< reserved for future use.
7421
+ /// @cond
7422
+ UR_EXP_ASYNC_USM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff
7423
+ /// @endcond
7424
+
7425
+ } ur_exp_async_usm_alloc_flag_t;
7426
+ /// @brief Bit Mask for validating ur_exp_async_usm_alloc_flags_t
7427
+ #define UR_EXP_ASYNC_USM_ALLOC_FLAGS_MASK 0xfffffffe
7428
+
7429
+ ///////////////////////////////////////////////////////////////////////////////
7430
+ /// @brief Async alloc properties
7431
+ typedef struct ur_exp_async_usm_alloc_properties_t {
7432
+ ur_structure_type_t stype; ///< [in] type of this structure, must be
7433
+ ///< ::UR_STRUCTURE_TYPE_EXP_ASYNC_USM_ALLOC_PROPERTIES
7434
+ void *pNext; ///< [in,out][optional] pointer to extension-specific structure
7435
+ ur_exp_async_usm_alloc_flags_t flags; ///< [in] async alloc flags
7436
+
7437
+ } ur_exp_async_usm_alloc_properties_t;
7438
+
7439
+ ///////////////////////////////////////////////////////////////////////////////
7440
+ /// @brief Enqueue an async device allocation
7441
+ ///
7442
+ /// @returns
7443
+ /// - ::UR_RESULT_SUCCESS
7444
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
7445
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
7446
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
7447
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
7448
+ /// + `NULL == hQueue`
7449
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
7450
+ /// + `NULL != pProperties && ::UR_EXP_ASYNC_USM_ALLOC_FLAGS_MASK & pProperties->flags`
7451
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
7452
+ /// + `NULL == ppMem`
7453
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
7454
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
7455
+ UR_APIEXPORT ur_result_t UR_APICALL
7456
+ urEnqueueUSMDeviceAllocExp(
7457
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
7458
+ ur_usm_pool_handle_t pPool, ///< [in][optional] USM pool descriptor
7459
+ const size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
7460
+ const ur_exp_async_usm_alloc_properties_t *pProperties, ///< [in][optional] pointer to the enqueue async alloc properties
7461
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
7462
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
7463
+ ///< events that must be complete before the kernel execution.
7464
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
7465
+ void **ppMem, ///< [out] pointer to USM memory object
7466
+ ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies the async alloc
7467
+ );
7468
+
7469
+ ///////////////////////////////////////////////////////////////////////////////
7470
+ /// @brief Enqueue an async shared allocation
7471
+ ///
7472
+ /// @returns
7473
+ /// - ::UR_RESULT_SUCCESS
7474
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
7475
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
7476
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
7477
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
7478
+ /// + `NULL == hQueue`
7479
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
7480
+ /// + `NULL != pProperties && ::UR_EXP_ASYNC_USM_ALLOC_FLAGS_MASK & pProperties->flags`
7481
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
7482
+ /// + `NULL == ppMem`
7483
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
7484
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
7485
+ UR_APIEXPORT ur_result_t UR_APICALL
7486
+ urEnqueueUSMSharedAllocExp(
7487
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
7488
+ ur_usm_pool_handle_t pPool, ///< [in][optional] USM pool descriptor
7489
+ const size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
7490
+ const ur_exp_async_usm_alloc_properties_t *pProperties, ///< [in][optional] pointer to the enqueue async alloc properties
7491
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
7492
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
7493
+ ///< events that must be complete before the kernel execution.
7494
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
7495
+ void **ppMem, ///< [out] pointer to USM memory object
7496
+ ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies the async alloc
7497
+ );
7498
+
7499
+ ///////////////////////////////////////////////////////////////////////////////
7500
+ /// @brief Enqueue an async host allocation
7501
+ ///
7502
+ /// @returns
7503
+ /// - ::UR_RESULT_SUCCESS
7504
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
7505
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
7506
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
7507
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
7508
+ /// + `NULL == hQueue`
7509
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
7510
+ /// + `NULL != pProperties && ::UR_EXP_ASYNC_USM_ALLOC_FLAGS_MASK & pProperties->flags`
7511
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
7512
+ /// + `NULL == ppMem`
7513
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
7514
+ /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
7515
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
7516
+ UR_APIEXPORT ur_result_t UR_APICALL
7517
+ urEnqueueUSMHostAllocExp(
7518
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
7519
+ ur_usm_pool_handle_t pPool, ///< [in][optional] USM pool descriptor
7520
+ const size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
7521
+ const ur_exp_async_usm_alloc_properties_t *pProperties, ///< [in][optional] pointer to the enqueue async alloc properties
7522
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
7523
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
7524
+ ///< events that must be complete before the kernel execution.
7525
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
7526
+ void **ppMem, ///< [out] pointer to USM memory object
7527
+ ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies the async alloc
7528
+ );
7529
+
7530
+ ///////////////////////////////////////////////////////////////////////////////
7531
+ /// @brief Enqueue an async host allocation
7532
+ ///
7533
+ /// @returns
7534
+ /// - ::UR_RESULT_SUCCESS
7535
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
7536
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
7537
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
7538
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
7539
+ /// + `NULL == hQueue`
7540
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
7541
+ /// + `NULL == pMem`
7542
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
7543
+ /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
7544
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
7545
+ UR_APIEXPORT ur_result_t UR_APICALL
7546
+ urEnqueueUSMFreeExp(
7547
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
7548
+ ur_usm_pool_handle_t pPool, ///< [in][optional] USM pool descriptor
7549
+ void *pMem, ///< [in] pointer to USM memory object
7550
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
7551
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
7552
+ ///< events that must be complete before the kernel execution.
7553
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
7554
+ ur_event_handle_t *phEvent ///< [out][optional] return an event object that identifies the async alloc
7555
+ );
7556
+
7398
7557
#if !defined(__GNUC__)
7399
7558
#pragma endregion
7400
7559
#endif
@@ -11423,6 +11582,64 @@ typedef struct ur_enqueue_kernel_launch_custom_exp_params_t {
11423
11582
ur_event_handle_t **pphEvent;
11424
11583
} ur_enqueue_kernel_launch_custom_exp_params_t;
11425
11584
11585
+ ///////////////////////////////////////////////////////////////////////////////
11586
+ /// @brief Function parameters for urEnqueueUSMDeviceAllocExp
11587
+ /// @details Each entry is a pointer to the parameter passed to the function;
11588
+ /// allowing the callback the ability to modify the parameter's value
11589
+ typedef struct ur_enqueue_usm_device_alloc_exp_params_t {
11590
+ ur_queue_handle_t *phQueue;
11591
+ ur_usm_pool_handle_t *ppPool;
11592
+ const size_t *psize;
11593
+ const ur_exp_async_usm_alloc_properties_t **ppProperties;
11594
+ uint32_t *pnumEventsInWaitList;
11595
+ const ur_event_handle_t **pphEventWaitList;
11596
+ void ***pppMem;
11597
+ ur_event_handle_t **pphEvent;
11598
+ } ur_enqueue_usm_device_alloc_exp_params_t;
11599
+
11600
+ ///////////////////////////////////////////////////////////////////////////////
11601
+ /// @brief Function parameters for urEnqueueUSMSharedAllocExp
11602
+ /// @details Each entry is a pointer to the parameter passed to the function;
11603
+ /// allowing the callback the ability to modify the parameter's value
11604
+ typedef struct ur_enqueue_usm_shared_alloc_exp_params_t {
11605
+ ur_queue_handle_t *phQueue;
11606
+ ur_usm_pool_handle_t *ppPool;
11607
+ const size_t *psize;
11608
+ const ur_exp_async_usm_alloc_properties_t **ppProperties;
11609
+ uint32_t *pnumEventsInWaitList;
11610
+ const ur_event_handle_t **pphEventWaitList;
11611
+ void ***pppMem;
11612
+ ur_event_handle_t **pphEvent;
11613
+ } ur_enqueue_usm_shared_alloc_exp_params_t;
11614
+
11615
+ ///////////////////////////////////////////////////////////////////////////////
11616
+ /// @brief Function parameters for urEnqueueUSMHostAllocExp
11617
+ /// @details Each entry is a pointer to the parameter passed to the function;
11618
+ /// allowing the callback the ability to modify the parameter's value
11619
+ typedef struct ur_enqueue_usm_host_alloc_exp_params_t {
11620
+ ur_queue_handle_t *phQueue;
11621
+ ur_usm_pool_handle_t *ppPool;
11622
+ const size_t *psize;
11623
+ const ur_exp_async_usm_alloc_properties_t **ppProperties;
11624
+ uint32_t *pnumEventsInWaitList;
11625
+ const ur_event_handle_t **pphEventWaitList;
11626
+ void ***pppMem;
11627
+ ur_event_handle_t **pphEvent;
11628
+ } ur_enqueue_usm_host_alloc_exp_params_t;
11629
+
11630
+ ///////////////////////////////////////////////////////////////////////////////
11631
+ /// @brief Function parameters for urEnqueueUSMFreeExp
11632
+ /// @details Each entry is a pointer to the parameter passed to the function;
11633
+ /// allowing the callback the ability to modify the parameter's value
11634
+ typedef struct ur_enqueue_usm_free_exp_params_t {
11635
+ ur_queue_handle_t *phQueue;
11636
+ ur_usm_pool_handle_t *ppPool;
11637
+ void **ppMem;
11638
+ uint32_t *pnumEventsInWaitList;
11639
+ const ur_event_handle_t **pphEventWaitList;
11640
+ ur_event_handle_t **pphEvent;
11641
+ } ur_enqueue_usm_free_exp_params_t;
11642
+
11426
11643
///////////////////////////////////////////////////////////////////////////////
11427
11644
/// @brief Function parameters for urEnqueueCooperativeKernelLaunchExp
11428
11645
/// @details Each entry is a pointer to the parameter passed to the function;
0 commit comments