@@ -165,7 +165,6 @@ class ur_function_v(IntEnum):
165
165
BINDLESS_IMAGES_DESTROY_EXTERNAL_SEMAPHORE_EXP = 147 ## Enumerator for ::urBindlessImagesDestroyExternalSemaphoreExp
166
166
BINDLESS_IMAGES_WAIT_EXTERNAL_SEMAPHORE_EXP = 148 ## Enumerator for ::urBindlessImagesWaitExternalSemaphoreExp
167
167
BINDLESS_IMAGES_SIGNAL_EXTERNAL_SEMAPHORE_EXP = 149 ## Enumerator for ::urBindlessImagesSignalExternalSemaphoreExp
168
- PLATFORM_GET_LAST_ERROR = 150 ## Enumerator for ::urPlatformGetLastError
169
168
ENQUEUE_USM_FILL_2D = 151 ## Enumerator for ::urEnqueueUSMFill2D
170
169
ENQUEUE_USM_MEMCPY_2D = 152 ## Enumerator for ::urEnqueueUSMMemcpy2D
171
170
VIRTUAL_MEM_GRANULARITY_GET_INFO = 153 ## Enumerator for ::urVirtualMemGranularityGetInfo
@@ -192,6 +191,11 @@ class ur_function_v(IntEnum):
192
191
LOADER_CONFIG_RETAIN = 174 ## Enumerator for ::urLoaderConfigRetain
193
192
LOADER_CONFIG_GET_INFO = 175 ## Enumerator for ::urLoaderConfigGetInfo
194
193
LOADER_CONFIG_ENABLE_LAYER = 176 ## Enumerator for ::urLoaderConfigEnableLayer
194
+ ADAPTER_RELEASE = 177 ## Enumerator for ::urAdapterRelease
195
+ ADAPTER_GET = 178 ## Enumerator for ::urAdapterGet
196
+ ADAPTER_RETAIN = 179 ## Enumerator for ::urAdapterRetain
197
+ ADAPTER_GET_LAST_ERROR = 180 ## Enumerator for ::urAdapterGetLastError
198
+ ADAPTER_GET_INFO = 181 ## Enumerator for ::urAdapterGetInfo
195
199
196
200
class ur_function_t (c_int ):
197
201
def __str__ (self ):
@@ -288,6 +292,11 @@ class ur_bool_t(c_ubyte):
288
292
class ur_loader_config_handle_t (c_void_p ):
289
293
pass
290
294
295
+ ###############################################################################
296
+ ## @brief Handle of an adapter instance
297
+ class ur_adapter_handle_t (c_void_p ):
298
+ pass
299
+
291
300
###############################################################################
292
301
## @brief Handle of a platform instance
293
302
class ur_platform_handle_t (c_void_p ):
@@ -501,6 +510,36 @@ def __str__(self):
501
510
return str (ur_loader_config_info_v (self .value ))
502
511
503
512
513
+ ###############################################################################
514
+ ## @brief Supported adapter info
515
+ class ur_adapter_info_v (IntEnum ):
516
+ BACKEND = 0 ## [::ur_adapter_backend_t] Identifies the native backend supported by
517
+ ## the adapter.
518
+ REFERENCE_COUNT = 1 ## [uint32_t] Reference count of the adapter.
519
+ ## The reference count returned should be considered immediately stale.
520
+ ## It is unsuitable for general use in applications. This feature is
521
+ ## provided for identifying memory leaks.
522
+
523
+ class ur_adapter_info_t (c_int ):
524
+ def __str__ (self ):
525
+ return str (ur_adapter_info_v (self .value ))
526
+
527
+
528
+ ###############################################################################
529
+ ## @brief Identifies backend of the adapter
530
+ class ur_adapter_backend_v (IntEnum ):
531
+ UNKNOWN = 0 ## The backend is not a recognized one
532
+ LEVEL_ZERO = 1 ## The backend is Level Zero
533
+ OPENCL = 2 ## The backend is OpenCL
534
+ CUDA = 3 ## The backend is CUDA
535
+ HIP = 4 ## The backend is HIP
536
+ NATIVE_CPU = 5 ## The backend is Native CPU
537
+
538
+ class ur_adapter_backend_t (c_int ):
539
+ def __str__ (self ):
540
+ return str (ur_adapter_backend_v (self .value ))
541
+
542
+
504
543
###############################################################################
505
544
## @brief Supported platform info
506
545
class ur_platform_info_v (IntEnum ):
@@ -2273,9 +2312,9 @@ class ur_loader_config_dditable_t(Structure):
2273
2312
###############################################################################
2274
2313
## @brief Function-pointer for urPlatformGet
2275
2314
if __use_win_types :
2276
- _urPlatformGet_t = WINFUNCTYPE ( ur_result_t , c_ulong , POINTER (ur_platform_handle_t ), POINTER (c_ulong ) )
2315
+ _urPlatformGet_t = WINFUNCTYPE ( ur_result_t , POINTER ( ur_adapter_handle_t ), c_ulong , c_ulong , POINTER (ur_platform_handle_t ), POINTER (c_ulong ) )
2277
2316
else :
2278
- _urPlatformGet_t = CFUNCTYPE ( ur_result_t , c_ulong , POINTER (ur_platform_handle_t ), POINTER (c_ulong ) )
2317
+ _urPlatformGet_t = CFUNCTYPE ( ur_result_t , POINTER ( ur_adapter_handle_t ), c_ulong , c_ulong , POINTER (ur_platform_handle_t ), POINTER (c_ulong ) )
2279
2318
2280
2319
###############################################################################
2281
2320
## @brief Function-pointer for urPlatformGetInfo
@@ -2298,13 +2337,6 @@ class ur_loader_config_dditable_t(Structure):
2298
2337
else :
2299
2338
_urPlatformCreateWithNativeHandle_t = CFUNCTYPE ( ur_result_t , ur_native_handle_t , POINTER (ur_platform_native_properties_t ), POINTER (ur_platform_handle_t ) )
2300
2339
2301
- ###############################################################################
2302
- ## @brief Function-pointer for urPlatformGetLastError
2303
- if __use_win_types :
2304
- _urPlatformGetLastError_t = WINFUNCTYPE ( ur_result_t , ur_platform_handle_t , POINTER (c_char_p ), POINTER (c_long ) )
2305
- else :
2306
- _urPlatformGetLastError_t = CFUNCTYPE ( ur_result_t , ur_platform_handle_t , POINTER (c_char_p ), POINTER (c_long ) )
2307
-
2308
2340
###############################################################################
2309
2341
## @brief Function-pointer for urPlatformGetApiVersion
2310
2342
if __use_win_types :
@@ -2328,7 +2360,6 @@ class ur_platform_dditable_t(Structure):
2328
2360
("pfnGetInfo" , c_void_p ), ## _urPlatformGetInfo_t
2329
2361
("pfnGetNativeHandle" , c_void_p ), ## _urPlatformGetNativeHandle_t
2330
2362
("pfnCreateWithNativeHandle" , c_void_p ), ## _urPlatformCreateWithNativeHandle_t
2331
- ("pfnGetLastError" , c_void_p ), ## _urPlatformGetLastError_t
2332
2363
("pfnGetApiVersion" , c_void_p ), ## _urPlatformGetApiVersion_t
2333
2364
("pfnGetBackendOption" , c_void_p ) ## _urPlatformGetBackendOption_t
2334
2365
]
@@ -3565,13 +3596,53 @@ class ur_usm_p2p_exp_dditable_t(Structure):
3565
3596
else :
3566
3597
_urTearDown_t = CFUNCTYPE ( ur_result_t , c_void_p )
3567
3598
3599
+ ###############################################################################
3600
+ ## @brief Function-pointer for urAdapterGet
3601
+ if __use_win_types :
3602
+ _urAdapterGet_t = WINFUNCTYPE ( ur_result_t , c_ulong , POINTER (ur_adapter_handle_t ), POINTER (c_ulong ) )
3603
+ else :
3604
+ _urAdapterGet_t = CFUNCTYPE ( ur_result_t , c_ulong , POINTER (ur_adapter_handle_t ), POINTER (c_ulong ) )
3605
+
3606
+ ###############################################################################
3607
+ ## @brief Function-pointer for urAdapterRelease
3608
+ if __use_win_types :
3609
+ _urAdapterRelease_t = WINFUNCTYPE ( ur_result_t , ur_adapter_handle_t )
3610
+ else :
3611
+ _urAdapterRelease_t = CFUNCTYPE ( ur_result_t , ur_adapter_handle_t )
3612
+
3613
+ ###############################################################################
3614
+ ## @brief Function-pointer for urAdapterRetain
3615
+ if __use_win_types :
3616
+ _urAdapterRetain_t = WINFUNCTYPE ( ur_result_t , ur_adapter_handle_t )
3617
+ else :
3618
+ _urAdapterRetain_t = CFUNCTYPE ( ur_result_t , ur_adapter_handle_t )
3619
+
3620
+ ###############################################################################
3621
+ ## @brief Function-pointer for urAdapterGetLastError
3622
+ if __use_win_types :
3623
+ _urAdapterGetLastError_t = WINFUNCTYPE ( ur_result_t , ur_adapter_handle_t , POINTER (c_char_p ), POINTER (c_long ) )
3624
+ else :
3625
+ _urAdapterGetLastError_t = CFUNCTYPE ( ur_result_t , ur_adapter_handle_t , POINTER (c_char_p ), POINTER (c_long ) )
3626
+
3627
+ ###############################################################################
3628
+ ## @brief Function-pointer for urAdapterGetInfo
3629
+ if __use_win_types :
3630
+ _urAdapterGetInfo_t = WINFUNCTYPE ( ur_result_t , ur_adapter_handle_t , ur_adapter_info_t , c_size_t , c_void_p , POINTER (c_size_t ) )
3631
+ else :
3632
+ _urAdapterGetInfo_t = CFUNCTYPE ( ur_result_t , ur_adapter_handle_t , ur_adapter_info_t , c_size_t , c_void_p , POINTER (c_size_t ) )
3633
+
3568
3634
3569
3635
###############################################################################
3570
3636
## @brief Table of Global functions pointers
3571
3637
class ur_global_dditable_t (Structure ):
3572
3638
_fields_ = [
3573
3639
("pfnInit" , c_void_p ), ## _urInit_t
3574
- ("pfnTearDown" , c_void_p ) ## _urTearDown_t
3640
+ ("pfnTearDown" , c_void_p ), ## _urTearDown_t
3641
+ ("pfnAdapterGet" , c_void_p ), ## _urAdapterGet_t
3642
+ ("pfnAdapterRelease" , c_void_p ), ## _urAdapterRelease_t
3643
+ ("pfnAdapterRetain" , c_void_p ), ## _urAdapterRetain_t
3644
+ ("pfnAdapterGetLastError" , c_void_p ), ## _urAdapterGetLastError_t
3645
+ ("pfnAdapterGetInfo" , c_void_p ) ## _urAdapterGetInfo_t
3575
3646
]
3576
3647
3577
3648
###############################################################################
@@ -3768,7 +3839,6 @@ def __init__(self, version : ur_api_version_t):
3768
3839
self .urPlatformGetInfo = _urPlatformGetInfo_t (self .__dditable .Platform .pfnGetInfo )
3769
3840
self .urPlatformGetNativeHandle = _urPlatformGetNativeHandle_t (self .__dditable .Platform .pfnGetNativeHandle )
3770
3841
self .urPlatformCreateWithNativeHandle = _urPlatformCreateWithNativeHandle_t (self .__dditable .Platform .pfnCreateWithNativeHandle )
3771
- self .urPlatformGetLastError = _urPlatformGetLastError_t (self .__dditable .Platform .pfnGetLastError )
3772
3842
self .urPlatformGetApiVersion = _urPlatformGetApiVersion_t (self .__dditable .Platform .pfnGetApiVersion )
3773
3843
self .urPlatformGetBackendOption = _urPlatformGetBackendOption_t (self .__dditable .Platform .pfnGetBackendOption )
3774
3844
@@ -4048,6 +4118,11 @@ def __init__(self, version : ur_api_version_t):
4048
4118
# attach function interface to function address
4049
4119
self .urInit = _urInit_t (self .__dditable .Global .pfnInit )
4050
4120
self .urTearDown = _urTearDown_t (self .__dditable .Global .pfnTearDown )
4121
+ self .urAdapterGet = _urAdapterGet_t (self .__dditable .Global .pfnAdapterGet )
4122
+ self .urAdapterRelease = _urAdapterRelease_t (self .__dditable .Global .pfnAdapterRelease )
4123
+ self .urAdapterRetain = _urAdapterRetain_t (self .__dditable .Global .pfnAdapterRetain )
4124
+ self .urAdapterGetLastError = _urAdapterGetLastError_t (self .__dditable .Global .pfnAdapterGetLastError )
4125
+ self .urAdapterGetInfo = _urAdapterGetInfo_t (self .__dditable .Global .pfnAdapterGetInfo )
4051
4126
4052
4127
# call driver to get function pointers
4053
4128
VirtualMem = ur_virtual_mem_dditable_t ()
0 commit comments