@@ -240,6 +240,7 @@ typedef enum ur_structure_type_t {
240240 UR_STRUCTURE_TYPE_QUEUE_PROPERTIES = 14 , ///< ::ur_queue_properties_t
241241 UR_STRUCTURE_TYPE_QUEUE_INDEX_PROPERTIES = 15 , ///< ::ur_queue_properties_t
242242 UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES = 16 , ///< ::ur_context_native_properties_t
243+ UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES = 17 , ///< ::ur_kernel_native_properties_t
243244 /// @cond
244245 UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff
245246 /// @endcond
@@ -3609,6 +3610,18 @@ urKernelGetNativeHandle(
36093610 ur_native_handle_t * phNativeKernel ///< [out] a pointer to the native handle of the kernel.
36103611);
36113612
3613+ ///////////////////////////////////////////////////////////////////////////////
3614+ /// @brief Properties for for ::urKernelCreateWithNativeHandle.
3615+ typedef struct ur_kernel_native_properties_t {
3616+ ur_structure_type_t stype ; ///< [in] type of this structure, must be
3617+ ///< ::UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES
3618+ void * pNext ; ///< [in,out][optional] pointer to extension-specific structure
3619+ bool isNativeHandleOwned ; ///< [in] Indicates UR owns the native handle or if it came from an interoperability
3620+ ///< operation in the application that asked to not transfer the ownership to
3621+ ///< the unified-runtime.
3622+
3623+ } ur_kernel_native_properties_t ;
3624+
36123625///////////////////////////////////////////////////////////////////////////////
36133626/// @brief Create runtime kernel object from native kernel handle.
36143627///
@@ -3625,13 +3638,17 @@ urKernelGetNativeHandle(
36253638/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
36263639/// + `NULL == hNativeKernel`
36273640/// + `NULL == hContext`
3641+ /// + `NULL == hProgram`
36283642/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
3643+ /// + `NULL == pProperties`
36293644/// + `NULL == phKernel`
36303645UR_APIEXPORT ur_result_t UR_APICALL
36313646urKernelCreateWithNativeHandle (
3632- ur_native_handle_t hNativeKernel , ///< [in] the native handle of the kernel.
3633- ur_context_handle_t hContext , ///< [in] handle of the context object
3634- ur_kernel_handle_t * phKernel ///< [out] pointer to the handle of the kernel object created.
3647+ ur_native_handle_t hNativeKernel , ///< [in] the native handle of the kernel.
3648+ ur_context_handle_t hContext , ///< [in] handle of the context object
3649+ ur_program_handle_t hProgram , ///< [in] handle of the program associated with the kernel
3650+ const ur_kernel_native_properties_t * pProperties , ///< [in] pointer to properties struct
3651+ ur_kernel_handle_t * phKernel ///< [out] pointer to the handle of the kernel object created.
36353652);
36363653
36373654#if !defined(__GNUC__ )
@@ -5920,6 +5937,8 @@ typedef struct ur_kernel_get_native_handle_params_t {
59205937typedef struct ur_kernel_create_with_native_handle_params_t {
59215938 ur_native_handle_t * phNativeKernel ;
59225939 ur_context_handle_t * phContext ;
5940+ ur_program_handle_t * phProgram ;
5941+ const ur_kernel_native_properties_t * * ppProperties ;
59235942 ur_kernel_handle_t * * pphKernel ;
59245943} ur_kernel_create_with_native_handle_params_t ;
59255944
0 commit comments