@@ -225,6 +225,7 @@ typedef enum ur_function_t {
225
225
UR_FUNCTION_KERNEL_GET_SUGGESTED_LOCAL_WORK_SIZE = 225, ///< Enumerator for ::urKernelGetSuggestedLocalWorkSize
226
226
UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_MEMORY_EXP = 226, ///< Enumerator for ::urBindlessImagesImportExternalMemoryExp
227
227
UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_SEMAPHORE_EXP = 227, ///< Enumerator for ::urBindlessImagesImportExternalSemaphoreExp
228
+ UR_FUNCTION_ENQUEUE_NATIVE_COMMAND_EXP = 228, ///< Enumerator for ::urEnqueueNativeCommandExp
228
229
/// @cond
229
230
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
230
231
/// @endcond
@@ -281,6 +282,7 @@ typedef enum ur_structure_type_t {
281
282
UR_STRUCTURE_TYPE_EXP_WIN32_HANDLE = 0x2004, ///< ::ur_exp_win32_handle_t
282
283
UR_STRUCTURE_TYPE_EXP_SAMPLER_ADDR_MODES = 0x2005, ///< ::ur_exp_sampler_addr_modes_t
283
284
UR_STRUCTURE_TYPE_EXP_SAMPLER_CUBEMAP_PROPERTIES = 0x2006, ///< ::ur_exp_sampler_cubemap_properties_t
285
+ UR_STRUCTURE_TYPE_EXP_ENQUEUE_NATIVE_COMMAND_PROPERTIES = 0x3000, ///< ::ur_exp_enqueue_native_command_properties_t
284
286
/// @cond
285
287
UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff
286
288
/// @endcond
@@ -1599,6 +1601,7 @@ typedef enum ur_device_info_t {
1599
1601
///< command-buffers.
1600
1602
UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP = 0x1001, ///< [::ur_bool_t] Returns true if the device supports updating the kernel
1601
1603
///< commands in a command-buffer.
1604
+ UR_DEVICE_INFO_CLUSTER_LAUNCH_EXP = 0x1111, ///< [::ur_bool_t] return true if enqueue Cluster Launch is supported
1602
1605
UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP = 0x2000, ///< [::ur_bool_t] returns true if the device supports the creation of
1603
1606
///< bindless images
1604
1607
UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP = 0x2001, ///< [::ur_bool_t] returns true if the device supports the creation of
@@ -1648,6 +1651,8 @@ typedef enum ur_device_info_t {
1648
1651
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP = 0x2017, ///< [::ur_bool_t] returns true if the device is capable of fetching
1649
1652
///< non-USM backed 3D sampled image data.
1650
1653
UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP = 0x2018, ///< [::ur_bool_t] returns true if the device supports timestamp recording
1654
+ UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP = 0x2020, ///< [::ur_bool_t] returns true if the device supports enqueueing of native
1655
+ ///< work
1651
1656
/// @cond
1652
1657
UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff
1653
1658
/// @endcond
@@ -1673,7 +1678,7 @@ typedef enum ur_device_info_t {
1673
1678
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
1674
1679
/// + `NULL == hDevice`
1675
1680
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
1676
- /// + `::UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP < propName`
1681
+ /// + `::UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP < propName`
1677
1682
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
1678
1683
/// + If `propName` is not supported by the adapter.
1679
1684
/// - ::UR_RESULT_ERROR_INVALID_SIZE
@@ -2820,6 +2825,8 @@ urMemBufferPartition(
2820
2825
/// - The application may call this function from simultaneous threads for
2821
2826
/// the same context.
2822
2827
/// - The implementation of this function should be thread-safe.
2828
+ /// - The implementation may require a valid device handle to return the
2829
+ /// native mem handle
2823
2830
///
2824
2831
/// @returns
2825
2832
/// - ::UR_RESULT_SUCCESS
@@ -2828,15 +2835,16 @@ urMemBufferPartition(
2828
2835
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
2829
2836
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
2830
2837
/// + `NULL == hMem`
2831
- /// + `NULL == hDevice`
2838
+ /// + If `hDevice == NULL` and the implementation requires a valid device.
2832
2839
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
2833
2840
/// + `NULL == phNativeMem`
2834
2841
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
2835
2842
/// + If the adapter has no underlying equivalent handle.
2836
2843
UR_APIEXPORT ur_result_t UR_APICALL
2837
2844
urMemGetNativeHandle(
2838
2845
ur_mem_handle_t hMem, ///< [in] handle of the mem.
2839
- ur_device_handle_t hDevice, ///< [in] handle of the device that the native handle will be resident on.
2846
+ ur_device_handle_t hDevice, ///< [in][optional] handle of the device that the native handle will be
2847
+ ///< resident on.
2840
2848
ur_native_handle_t *phNativeMem ///< [out] a pointer to the native handle of the mem.
2841
2849
);
2842
2850
@@ -5683,6 +5691,7 @@ typedef enum ur_command_t {
5683
5691
UR_COMMAND_INTEROP_SEMAPHORE_WAIT_EXP = 0x2000, ///< Event created by ::urBindlessImagesWaitExternalSemaphoreExp
5684
5692
UR_COMMAND_INTEROP_SEMAPHORE_SIGNAL_EXP = 0x2001, ///< Event created by ::urBindlessImagesSignalExternalSemaphoreExp
5685
5693
UR_COMMAND_TIMESTAMP_RECORDING_EXP = 0x2002, ///< Event created by ::urEnqueueTimestampRecordingExp
5694
+ UR_COMMAND_ENQUEUE_NATIVE_EXP = 0x2004, ///< Event created by ::urEnqueueNativeCommandExp
5686
5695
/// @cond
5687
5696
UR_COMMAND_FORCE_UINT32 = 0x7fffffff
5688
5697
/// @endcond
@@ -9497,6 +9506,80 @@ urUsmP2PPeerAccessGetInfoExp(
9497
9506
size_t *pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName.
9498
9507
);
9499
9508
9509
+ #if !defined(__GNUC__)
9510
+ #pragma endregion
9511
+ #endif
9512
+ // Intel 'oneAPI' Unified Runtime Experimental API for enqueuing work through native APIs
9513
+ #if !defined(__GNUC__)
9514
+ #pragma region native enqueue(experimental)
9515
+ #endif
9516
+ ///////////////////////////////////////////////////////////////////////////////
9517
+ /// @brief Native enqueue properties
9518
+ typedef uint32_t ur_exp_enqueue_native_command_flags_t;
9519
+ typedef enum ur_exp_enqueue_native_command_flag_t {
9520
+ UR_EXP_ENQUEUE_NATIVE_COMMAND_FLAG_TBD = UR_BIT(0), ///< reserved for future use.
9521
+ /// @cond
9522
+ UR_EXP_ENQUEUE_NATIVE_COMMAND_FLAG_FORCE_UINT32 = 0x7fffffff
9523
+ /// @endcond
9524
+
9525
+ } ur_exp_enqueue_native_command_flag_t;
9526
+ /// @brief Bit Mask for validating ur_exp_enqueue_native_command_flags_t
9527
+ #define UR_EXP_ENQUEUE_NATIVE_COMMAND_FLAGS_MASK 0xfffffffe
9528
+
9529
+ ///////////////////////////////////////////////////////////////////////////////
9530
+ /// @brief Native enqueue properties
9531
+ typedef struct ur_exp_enqueue_native_command_properties_t {
9532
+ ur_structure_type_t stype; ///< [in] type of this structure, must be
9533
+ ///< ::UR_STRUCTURE_TYPE_EXP_ENQUEUE_NATIVE_COMMAND_PROPERTIES
9534
+ void *pNext; ///< [in,out][optional] pointer to extension-specific structure
9535
+ ur_exp_enqueue_native_command_flags_t flags; ///< [in] native enqueue flags
9536
+
9537
+ } ur_exp_enqueue_native_command_properties_t;
9538
+
9539
+ ///////////////////////////////////////////////////////////////////////////////
9540
+ /// @brief Function enqueueing work through the native API to be executed
9541
+ /// immediately.
9542
+ typedef void (*ur_exp_enqueue_native_command_function_t)(
9543
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
9544
+ void *pUserData ///< [in][out] pointer to data to be passed to callback
9545
+ );
9546
+
9547
+ ///////////////////////////////////////////////////////////////////////////////
9548
+ /// @brief Immediately enqueue work through a native backend API
9549
+ ///
9550
+ /// @returns
9551
+ /// - ::UR_RESULT_SUCCESS
9552
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
9553
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
9554
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9555
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9556
+ /// + `NULL == hQueue`
9557
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9558
+ /// + `NULL == pfnNativeEnqueue`
9559
+ /// + `NULL == phEvent`
9560
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
9561
+ /// + `NULL != pProperties && ::UR_EXP_ENQUEUE_NATIVE_COMMAND_FLAGS_MASK & pProperties->flags`
9562
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
9563
+ UR_APIEXPORT ur_result_t UR_APICALL
9564
+ urEnqueueNativeCommandExp(
9565
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
9566
+ ur_exp_enqueue_native_command_function_t pfnNativeEnqueue, ///< [in] function calling the native underlying API, to be executed
9567
+ ///< immediately.
9568
+ void *data, ///< [in][optional] data used by pfnNativeEnqueue
9569
+ uint32_t numMemsInMemList, ///< [in] size of the mem list
9570
+ const ur_mem_handle_t *phMemList, ///< [in][optional][range(0, numMemsInMemList)] mems that are used within
9571
+ ///< pfnNativeEnqueue using ::urMemGetNativeHandle.
9572
+ ///< If nullptr, the numMemsInMemList must be 0, indicating that no mems
9573
+ ///< are accessed with ::urMemGetNativeHandle within pfnNativeEnqueue.
9574
+ const ur_exp_enqueue_native_command_properties_t *pProperties, ///< [in][optional] pointer to the native enqueue properties
9575
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
9576
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
9577
+ ///< events that must be complete before the kernel execution.
9578
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
9579
+ ur_event_handle_t *phEvent ///< [in,out] return an event object that identifies the work that has
9580
+ ///< been enqueued in nativeEnqueueFunc.
9581
+ );
9582
+
9500
9583
#if !defined(__GNUC__)
9501
9584
#pragma endregion
9502
9585
#endif
@@ -10916,6 +10999,22 @@ typedef struct ur_enqueue_timestamp_recording_exp_params_t {
10916
10999
ur_event_handle_t **pphEvent;
10917
11000
} ur_enqueue_timestamp_recording_exp_params_t;
10918
11001
11002
+ ///////////////////////////////////////////////////////////////////////////////
11003
+ /// @brief Function parameters for urEnqueueNativeCommandExp
11004
+ /// @details Each entry is a pointer to the parameter passed to the function;
11005
+ /// allowing the callback the ability to modify the parameter's value
11006
+ typedef struct ur_enqueue_native_command_exp_params_t {
11007
+ ur_queue_handle_t *phQueue;
11008
+ ur_exp_enqueue_native_command_function_t *ppfnNativeEnqueue;
11009
+ void **pdata;
11010
+ uint32_t *pnumMemsInMemList;
11011
+ const ur_mem_handle_t **pphMemList;
11012
+ const ur_exp_enqueue_native_command_properties_t **ppProperties;
11013
+ uint32_t *pnumEventsInWaitList;
11014
+ const ur_event_handle_t **pphEventWaitList;
11015
+ ur_event_handle_t **pphEvent;
11016
+ } ur_enqueue_native_command_exp_params_t;
11017
+
10919
11018
///////////////////////////////////////////////////////////////////////////////
10920
11019
/// @brief Function parameters for urBindlessImagesUnsampledImageHandleDestroyExp
10921
11020
/// @details Each entry is a pointer to the parameter passed to the function;
0 commit comments