@@ -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
@@ -1648,6 +1650,8 @@ typedef enum ur_device_info_t {
1648
1650
UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_3D_EXP = 0x2017, ///< [::ur_bool_t] returns true if the device is capable of fetching
1649
1651
///< non-USM backed 3D sampled image data.
1650
1652
UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP = 0x2018, ///< [::ur_bool_t] returns true if the device supports timestamp recording
1653
+ UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP = 0x2020, ///< [::ur_bool_t] returns true if the device supports enqueueing of native
1654
+ ///< work
1651
1655
/// @cond
1652
1656
UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff
1653
1657
/// @endcond
@@ -1673,7 +1677,7 @@ typedef enum ur_device_info_t {
1673
1677
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
1674
1678
/// + `NULL == hDevice`
1675
1679
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
1676
- /// + `::UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP < propName`
1680
+ /// + `::UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP < propName`
1677
1681
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
1678
1682
/// + If `propName` is not supported by the adapter.
1679
1683
/// - ::UR_RESULT_ERROR_INVALID_SIZE
@@ -5683,6 +5687,7 @@ typedef enum ur_command_t {
5683
5687
UR_COMMAND_INTEROP_SEMAPHORE_WAIT_EXP = 0x2000, ///< Event created by ::urBindlessImagesWaitExternalSemaphoreExp
5684
5688
UR_COMMAND_INTEROP_SEMAPHORE_SIGNAL_EXP = 0x2001, ///< Event created by ::urBindlessImagesSignalExternalSemaphoreExp
5685
5689
UR_COMMAND_TIMESTAMP_RECORDING_EXP = 0x2002, ///< Event created by ::urEnqueueTimestampRecordingExp
5690
+ UR_COMMAND_ENQUEUE_NATIVE_EXP = 0x2004, ///< Event created by ::urEnqueueNativeCommandExp
5686
5691
/// @cond
5687
5692
UR_COMMAND_FORCE_UINT32 = 0x7fffffff
5688
5693
/// @endcond
@@ -9497,6 +9502,80 @@ urUsmP2PPeerAccessGetInfoExp(
9497
9502
size_t *pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName.
9498
9503
);
9499
9504
9505
+ #if !defined(__GNUC__)
9506
+ #pragma endregion
9507
+ #endif
9508
+ // Intel 'oneAPI' Unified Runtime Experimental API for enqueuing work through native APIs
9509
+ #if !defined(__GNUC__)
9510
+ #pragma region native enqueue(experimental)
9511
+ #endif
9512
+ ///////////////////////////////////////////////////////////////////////////////
9513
+ /// @brief Native enqueue properties
9514
+ typedef uint32_t ur_exp_enqueue_native_command_flags_t;
9515
+ typedef enum ur_exp_enqueue_native_command_flag_t {
9516
+ UR_EXP_ENQUEUE_NATIVE_COMMAND_FLAG_TBD = UR_BIT(0), ///< reserved for future use.
9517
+ /// @cond
9518
+ UR_EXP_ENQUEUE_NATIVE_COMMAND_FLAG_FORCE_UINT32 = 0x7fffffff
9519
+ /// @endcond
9520
+
9521
+ } ur_exp_enqueue_native_command_flag_t;
9522
+ /// @brief Bit Mask for validating ur_exp_enqueue_native_command_flags_t
9523
+ #define UR_EXP_ENQUEUE_NATIVE_COMMAND_FLAGS_MASK 0xfffffffe
9524
+
9525
+ ///////////////////////////////////////////////////////////////////////////////
9526
+ /// @brief Native enqueue properties
9527
+ typedef struct ur_exp_enqueue_native_command_properties_t {
9528
+ ur_structure_type_t stype; ///< [in] type of this structure, must be
9529
+ ///< ::UR_STRUCTURE_TYPE_EXP_ENQUEUE_NATIVE_COMMAND_PROPERTIES
9530
+ void *pNext; ///< [in,out][optional] pointer to extension-specific structure
9531
+ ur_exp_enqueue_native_command_flags_t flags; ///< [in] native enqueue flags
9532
+
9533
+ } ur_exp_enqueue_native_command_properties_t;
9534
+
9535
+ ///////////////////////////////////////////////////////////////////////////////
9536
+ /// @brief Function enqueueing work through the native API to be executed
9537
+ /// immediately.
9538
+ typedef void (*ur_exp_enqueue_native_command_function_t)(
9539
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
9540
+ void *pUserData ///< [in][out] pointer to data to be passed to callback
9541
+ );
9542
+
9543
+ ///////////////////////////////////////////////////////////////////////////////
9544
+ /// @brief Immediately enqueue work through a native backend API
9545
+ ///
9546
+ /// @returns
9547
+ /// - ::UR_RESULT_SUCCESS
9548
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
9549
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
9550
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9551
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9552
+ /// + `NULL == hQueue`
9553
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9554
+ /// + `NULL == pfnNativeEnqueue`
9555
+ /// + `NULL == phEvent`
9556
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
9557
+ /// + `NULL != pProperties && ::UR_EXP_ENQUEUE_NATIVE_COMMAND_FLAGS_MASK & pProperties->flags`
9558
+ /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
9559
+ UR_APIEXPORT ur_result_t UR_APICALL
9560
+ urEnqueueNativeCommandExp(
9561
+ ur_queue_handle_t hQueue, ///< [in] handle of the queue object
9562
+ ur_exp_enqueue_native_command_function_t pfnNativeEnqueue, ///< [in] function calling the native underlying API, to be executed
9563
+ ///< immediately.
9564
+ void *data, ///< [in][optional] data used by pfnNativeEnqueue
9565
+ uint32_t numMemsInMemList, ///< [in] size of the mem list
9566
+ const ur_mem_handle_t *phMemList, ///< [in][optional][range(0, numMemsInMemList)] mems that are used within
9567
+ ///< pfnNativeEnqueue using ::urMemGetNativeHandle.
9568
+ ///< If nullptr, the numMemsInMemList must be 0, indicating that no mems
9569
+ ///< are accessed with ::urMemGetNativeHandle within pfnNativeEnqueue.
9570
+ const ur_exp_enqueue_native_command_properties_t *pProperties, ///< [in][optional] pointer to the native enqueue properties
9571
+ uint32_t numEventsInWaitList, ///< [in] size of the event wait list
9572
+ const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
9573
+ ///< events that must be complete before the kernel execution.
9574
+ ///< If nullptr, the numEventsInWaitList must be 0, indicating no wait events.
9575
+ ur_event_handle_t *phEvent ///< [in,out] return an event object that identifies the work that has
9576
+ ///< been enqueued in nativeEnqueueFunc.
9577
+ );
9578
+
9500
9579
#if !defined(__GNUC__)
9501
9580
#pragma endregion
9502
9581
#endif
@@ -10916,6 +10995,22 @@ typedef struct ur_enqueue_timestamp_recording_exp_params_t {
10916
10995
ur_event_handle_t **pphEvent;
10917
10996
} ur_enqueue_timestamp_recording_exp_params_t;
10918
10997
10998
+ ///////////////////////////////////////////////////////////////////////////////
10999
+ /// @brief Function parameters for urEnqueueNativeCommandExp
11000
+ /// @details Each entry is a pointer to the parameter passed to the function;
11001
+ /// allowing the callback the ability to modify the parameter's value
11002
+ typedef struct ur_enqueue_native_command_exp_params_t {
11003
+ ur_queue_handle_t *phQueue;
11004
+ ur_exp_enqueue_native_command_function_t *ppfnNativeEnqueue;
11005
+ void **pdata;
11006
+ uint32_t *pnumMemsInMemList;
11007
+ const ur_mem_handle_t **pphMemList;
11008
+ const ur_exp_enqueue_native_command_properties_t **ppProperties;
11009
+ uint32_t *pnumEventsInWaitList;
11010
+ const ur_event_handle_t **pphEventWaitList;
11011
+ ur_event_handle_t **pphEvent;
11012
+ } ur_enqueue_native_command_exp_params_t;
11013
+
10919
11014
///////////////////////////////////////////////////////////////////////////////
10920
11015
/// @brief Function parameters for urBindlessImagesUnsampledImageHandleDestroyExp
10921
11016
/// @details Each entry is a pointer to the parameter passed to the function;
0 commit comments