@@ -202,6 +202,10 @@ class ur_function_v(IntEnum):
202
202
KERNEL_SUGGEST_MAX_COOPERATIVE_GROUP_COUNT_EXP = 194 ## Enumerator for ::urKernelSuggestMaxCooperativeGroupCountExp
203
203
COMMAND_BUFFER_APPEND_USM_PREFETCH_EXP = 195 ## Enumerator for ::urCommandBufferAppendUSMPrefetchExp
204
204
COMMAND_BUFFER_APPEND_USM_ADVISE_EXP = 196 ## Enumerator for ::urCommandBufferAppendUSMAdviseExp
205
+ PROGRAM_BUILD_EXP = 197 ## Enumerator for ::urProgramBuildExp
206
+ PROGRAM_COMPILE_EXP = 198 ## Enumerator for ::urProgramCompileExp
207
+ PROGRAM_LINK_EXP = 199 ## Enumerator for ::urProgramLinkExp
208
+ LOADER_CONFIG_SET_CODE_LOCATION_CALLBACK = 200 ## Enumerator for ::urLoaderConfigSetCodeLocationCallback
205
209
206
210
class ur_function_t (c_int ):
207
211
def __str__ (self ):
@@ -518,6 +522,24 @@ def __str__(self):
518
522
return str (ur_loader_config_info_v (self .value ))
519
523
520
524
525
+ ###############################################################################
526
+ ## @brief Code location data
527
+ class ur_code_location_t (Structure ):
528
+ _fields_ = [
529
+ ("functionName" , c_char_p ), ## [in][out] Function name.
530
+ ("sourceFile" , c_char_p ), ## [in][out] Source code file.
531
+ ("lineNumber" , c_ulong ), ## [in][out] Source code line number.
532
+ ("columnNumber" , c_ulong ) ## [in][out] Source code column number.
533
+ ]
534
+
535
+ ###############################################################################
536
+ ## @brief Code location callback with user data.
537
+ def ur_code_location_callback_t (user_defined_callback ):
538
+ @CFUNCTYPE (ur_code_location_t , c_void_p )
539
+ def ur_code_location_callback_t_wrapper (pUserData ):
540
+ return user_defined_callback (pUserData )
541
+ return ur_code_location_callback_t_wrapper
542
+
521
543
###############################################################################
522
544
## @brief Supported adapter info
523
545
class ur_adapter_info_v (IntEnum ):
@@ -2106,10 +2128,10 @@ class ur_event_native_properties_t(Structure):
2106
2128
###############################################################################
2107
2129
## @brief Event states for all events.
2108
2130
class ur_execution_info_v (IntEnum ):
2109
- EXECUTION_INFO_COMPLETE = 0 ## Indicates that the event has completed.
2110
- EXECUTION_INFO_RUNNING = 1 ## Indicates that the device has started processing this event.
2111
- EXECUTION_INFO_SUBMITTED = 2 ## Indicates that the event has been submitted by the host to the device.
2112
- EXECUTION_INFO_QUEUED = 3 ## Indicates that the event has been queued, this is the initial state of
2131
+ COMPLETE = 0 ## Indicates that the event has completed.
2132
+ RUNNING = 1 ## Indicates that the device has started processing this event.
2133
+ SUBMITTED = 2 ## Indicates that the event has been submitted by the host to the device.
2134
+ QUEUED = 3 ## Indicates that the event has been queued, this is the initial state of
2113
2135
## events.
2114
2136
2115
2137
class ur_execution_info_t (c_int ):
@@ -2296,6 +2318,11 @@ class ur_exp_command_buffer_handle_t(c_void_p):
2296
2318
## which is returned when querying device extensions.
2297
2319
UR_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP = "ur_exp_cooperative_kernels"
2298
2320
2321
+ ###############################################################################
2322
+ ## @brief The extension string which defines support for test
2323
+ ## which is returned when querying device extensions.
2324
+ UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP = "ur_exp_multi_device_compile"
2325
+
2299
2326
###############################################################################
2300
2327
## @brief Supported peer info
2301
2328
class ur_exp_peer_info_v (IntEnum ):
@@ -2612,6 +2639,37 @@ class ur_program_dditable_t(Structure):
2612
2639
("pfnCreateWithNativeHandle" , c_void_p ) ## _urProgramCreateWithNativeHandle_t
2613
2640
]
2614
2641
2642
+ ###############################################################################
2643
+ ## @brief Function-pointer for urProgramBuildExp
2644
+ if __use_win_types :
2645
+ _urProgramBuildExp_t = WINFUNCTYPE ( ur_result_t , ur_program_handle_t , c_ulong , POINTER (ur_device_handle_t ), c_char_p )
2646
+ else :
2647
+ _urProgramBuildExp_t = CFUNCTYPE ( ur_result_t , ur_program_handle_t , c_ulong , POINTER (ur_device_handle_t ), c_char_p )
2648
+
2649
+ ###############################################################################
2650
+ ## @brief Function-pointer for urProgramCompileExp
2651
+ if __use_win_types :
2652
+ _urProgramCompileExp_t = WINFUNCTYPE ( ur_result_t , ur_program_handle_t , c_ulong , POINTER (ur_device_handle_t ), c_char_p )
2653
+ else :
2654
+ _urProgramCompileExp_t = CFUNCTYPE ( ur_result_t , ur_program_handle_t , c_ulong , POINTER (ur_device_handle_t ), c_char_p )
2655
+
2656
+ ###############################################################################
2657
+ ## @brief Function-pointer for urProgramLinkExp
2658
+ if __use_win_types :
2659
+ _urProgramLinkExp_t = WINFUNCTYPE ( ur_result_t , ur_context_handle_t , c_ulong , POINTER (ur_device_handle_t ), c_ulong , POINTER (ur_program_handle_t ), c_char_p , POINTER (ur_program_handle_t ) )
2660
+ else :
2661
+ _urProgramLinkExp_t = CFUNCTYPE ( ur_result_t , ur_context_handle_t , c_ulong , POINTER (ur_device_handle_t ), c_ulong , POINTER (ur_program_handle_t ), c_char_p , POINTER (ur_program_handle_t ) )
2662
+
2663
+
2664
+ ###############################################################################
2665
+ ## @brief Table of ProgramExp functions pointers
2666
+ class ur_program_exp_dditable_t (Structure ):
2667
+ _fields_ = [
2668
+ ("pfnBuildExp" , c_void_p ), ## _urProgramBuildExp_t
2669
+ ("pfnCompileExp" , c_void_p ), ## _urProgramCompileExp_t
2670
+ ("pfnLinkExp" , c_void_p ) ## _urProgramLinkExp_t
2671
+ ]
2672
+
2615
2673
###############################################################################
2616
2674
## @brief Function-pointer for urKernelCreate
2617
2675
if __use_win_types :
@@ -3843,6 +3901,7 @@ class ur_dditable_t(Structure):
3843
3901
("Context" , ur_context_dditable_t ),
3844
3902
("Event" , ur_event_dditable_t ),
3845
3903
("Program" , ur_program_dditable_t ),
3904
+ ("ProgramExp" , ur_program_exp_dditable_t ),
3846
3905
("Kernel" , ur_kernel_dditable_t ),
3847
3906
("KernelExp" , ur_kernel_exp_dditable_t ),
3848
3907
("Sampler" , ur_sampler_dditable_t ),
@@ -3947,6 +4006,18 @@ def __init__(self, version : ur_api_version_t):
3947
4006
self .urProgramGetNativeHandle = _urProgramGetNativeHandle_t (self .__dditable .Program .pfnGetNativeHandle )
3948
4007
self .urProgramCreateWithNativeHandle = _urProgramCreateWithNativeHandle_t (self .__dditable .Program .pfnCreateWithNativeHandle )
3949
4008
4009
+ # call driver to get function pointers
4010
+ ProgramExp = ur_program_exp_dditable_t ()
4011
+ r = ur_result_v (self .__dll .urGetProgramExpProcAddrTable (version , byref (ProgramExp )))
4012
+ if r != ur_result_v .SUCCESS :
4013
+ raise Exception (r )
4014
+ self .__dditable .ProgramExp = ProgramExp
4015
+
4016
+ # attach function interface to function address
4017
+ self .urProgramBuildExp = _urProgramBuildExp_t (self .__dditable .ProgramExp .pfnBuildExp )
4018
+ self .urProgramCompileExp = _urProgramCompileExp_t (self .__dditable .ProgramExp .pfnCompileExp )
4019
+ self .urProgramLinkExp = _urProgramLinkExp_t (self .__dditable .ProgramExp .pfnLinkExp )
4020
+
3950
4021
# call driver to get function pointers
3951
4022
Kernel = ur_kernel_dditable_t ()
3952
4023
r = ur_result_v (self .__dll .urGetKernelProcAddrTable (version , byref (Kernel )))
0 commit comments