@@ -225,6 +225,7 @@ class ur_structure_type_v(IntEnum):
225
225
PROGRAM_NATIVE_PROPERTIES = 23 ## ::ur_program_native_properties_t
226
226
SAMPLER_NATIVE_PROPERTIES = 24 ## ::ur_sampler_native_properties_t
227
227
QUEUE_NATIVE_DESC = 25 ## ::ur_queue_native_desc_t
228
+ DEVICE_PARTITION_PROPERTIES = 26 ## ::ur_device_partition_properties_t
228
229
229
230
class ur_structure_type_t (c_int ):
230
231
def __str__ (self ):
@@ -502,8 +503,8 @@ class ur_device_info_v(IntEnum):
502
503
PREFERRED_INTEROP_USER_SYNC = 74 ## [::ur_bool_t] prefer user synchronization when sharing object with
503
504
## other API
504
505
PARENT_DEVICE = 75 ## [::ur_device_handle_t] return parent device handle
505
- PARTITION_PROPERTIES = 76 ## [::ur_device_partition_property_t []] Returns an array of partition
506
- ## types supported by the device
506
+ SUPPORTED_PARTITIONS = 76 ## [::ur_device_partition_t []] Returns an array of partition types
507
+ ## supported by the device
507
508
PARTITION_MAX_SUB_DEVICES = 77 ## [uint32_t] maximum number of sub-devices when the device is
508
509
## partitioned
509
510
PARTITION_AFFINITY_DOMAIN = 78 ## [::ur_device_affinity_domain_flags_t] Returns a bit-field of the
@@ -569,16 +570,39 @@ def __str__(self):
569
570
570
571
571
572
###############################################################################
572
- ## @brief Device partition property type
573
- class ur_device_partition_property_t (c_intptr_t ):
574
- pass
573
+ ## @brief Device affinity domain
574
+ class ur_device_affinity_domain_flags_v (IntEnum ):
575
+ NUMA = UR_BIT (0 ) ## Split the device into sub devices comprised of compute units that
576
+ ## share a NUMA node.
577
+ L4_CACHE = UR_BIT (1 ) ## Split the device into sub devices comprised of compute units that
578
+ ## share a level 4 data cache.
579
+ L3_CACHE = UR_BIT (2 ) ## Split the device into sub devices comprised of compute units that
580
+ ## share a level 3 data cache.
581
+ L2_CACHE = UR_BIT (3 ) ## Split the device into sub devices comprised of compute units that
582
+ ## share a level 2 data cache.
583
+ L1_CACHE = UR_BIT (4 ) ## Split the device into sub devices comprised of compute units that
584
+ ## share a level 1 data cache.
585
+ NEXT_PARTITIONABLE = UR_BIT (5 ) ## Split the device along the next partitionable affinity domain.
586
+ ## The implementation shall find the first level along which the device
587
+ ## or sub device may be further subdivided in the order:
588
+ ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA,
589
+ ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_L4_CACHE,
590
+ ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_L3_CACHE,
591
+ ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_L2_CACHE,
592
+ ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_L1_CACHE,
593
+ ## and partition the device into sub devices comprised of compute units
594
+ ## that share memory subsystems at this level.
595
+
596
+ class ur_device_affinity_domain_flags_t (c_int ):
597
+ def __str__ (self ):
598
+ return hex (self .value )
599
+
575
600
576
601
###############################################################################
577
602
## @brief Partition Properties
578
603
class ur_device_partition_v (IntEnum ):
579
604
EQUALLY = 0x1086 ## Partition Equally
580
605
BY_COUNTS = 0x1087 ## Partition by counts
581
- BY_COUNTS_LIST_END = 0x0 ## End of by counts list
582
606
BY_AFFINITY_DOMAIN = 0x1088 ## Partition by affinity domain
583
607
BY_CSLICE = 0x1089 ## Partition by c-slice
584
608
@@ -587,6 +611,37 @@ def __str__(self):
587
611
return str (ur_device_partition_v (self .value ))
588
612
589
613
614
+ ###############################################################################
615
+ ## @brief Device partition value.
616
+ class ur_device_partition_value_t (Structure ):
617
+ _fields_ = [
618
+ ("equally" , c_ulong ), ## [in] Number of compute units per sub-device when partitioning with
619
+ ## ::UR_DEVICE_PARTITION_EQUALLY.
620
+ ("count" , c_ulong ), ## [in] Number of compute units in a sub-device when partitioning with
621
+ ## ::UR_DEVICE_PARTITION_BY_COUNTS.
622
+ ("affinity_domain" , ur_device_affinity_domain_flags_t ) ## [in] The affinity domain to partition for when partitioning with
623
+ ## $UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN.
624
+ ]
625
+
626
+ ###############################################################################
627
+ ## @brief Device partition property
628
+ class ur_device_partition_property_t (Structure ):
629
+ _fields_ = [
630
+ ("type" , ur_device_partition_t ), ## [in] The partitioning type to be used.
631
+ ("value" , ur_device_partition_value_t ) ## [in] The paritioning value.
632
+ ]
633
+
634
+ ###############################################################################
635
+ ## @brief Device Partition Properties
636
+ class ur_device_partition_properties_t (Structure ):
637
+ _fields_ = [
638
+ ("stype" , ur_structure_type_t ), ## [in] type of this structure, must be
639
+ ## ::UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES
640
+ ("pNext" , c_void_p ), ## [in,out][optional] pointer to extension-specific structure
641
+ ("pProperties" , POINTER (ur_device_partition_property_t )), ## [in] Pointer to the beginning of the properties array.
642
+ ("PropCount" , c_size_t ) ## [in] The length of properties pointed to by `pProperties`.
643
+ ]
644
+
590
645
###############################################################################
591
646
## @brief FP capabilities
592
647
class ur_device_fp_capability_flags_v (IntEnum ):
@@ -639,35 +694,6 @@ def __str__(self):
639
694
return hex (self .value )
640
695
641
696
642
- ###############################################################################
643
- ## @brief Device affinity domain
644
- class ur_device_affinity_domain_flags_v (IntEnum ):
645
- NUMA = UR_BIT (0 ) ## Split the device into sub devices comprised of compute units that
646
- ## share a NUMA node.
647
- L4_CACHE = UR_BIT (1 ) ## Split the device into sub devices comprised of compute units that
648
- ## share a level 4 data cache.
649
- L3_CACHE = UR_BIT (2 ) ## Split the device into sub devices comprised of compute units that
650
- ## share a level 3 data cache.
651
- L2_CACHE = UR_BIT (3 ) ## Split the device into sub devices comprised of compute units that
652
- ## share a level 2 data cache.
653
- L1_CACHE = UR_BIT (4 ) ## Split the device into sub devices comprised of compute units that
654
- ## share a level 1 data cache.
655
- NEXT_PARTITIONABLE = UR_BIT (5 ) ## Split the device along the next partitionable affinity domain.
656
- ## The implementation shall find the first level along which the device
657
- ## or sub device may be further subdivided in the order:
658
- ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA,
659
- ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_L4_CACHE,
660
- ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_L3_CACHE,
661
- ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_L2_CACHE,
662
- ## ::UR_DEVICE_AFFINITY_DOMAIN_FLAG_L1_CACHE,
663
- ## and partition the device into sub devices comprised of compute units
664
- ## that share memory subsystems at this level.
665
-
666
- class ur_device_affinity_domain_flags_t (c_int ):
667
- def __str__ (self ):
668
- return hex (self .value )
669
-
670
-
671
697
###############################################################################
672
698
## @brief Native device creation properties
673
699
class ur_device_native_properties_t (Structure ):
@@ -2805,9 +2831,9 @@ class ur_usm_dditable_t(Structure):
2805
2831
###############################################################################
2806
2832
## @brief Function-pointer for urDevicePartition
2807
2833
if __use_win_types :
2808
- _urDevicePartition_t = WINFUNCTYPE ( ur_result_t , ur_device_handle_t , POINTER (ur_device_partition_property_t ), c_ulong , POINTER (ur_device_handle_t ), POINTER (c_ulong ) )
2834
+ _urDevicePartition_t = WINFUNCTYPE ( ur_result_t , ur_device_handle_t , POINTER (ur_device_partition_properties_t ), c_ulong , POINTER (ur_device_handle_t ), POINTER (c_ulong ) )
2809
2835
else :
2810
- _urDevicePartition_t = CFUNCTYPE ( ur_result_t , ur_device_handle_t , POINTER (ur_device_partition_property_t ), c_ulong , POINTER (ur_device_handle_t ), POINTER (c_ulong ) )
2836
+ _urDevicePartition_t = CFUNCTYPE ( ur_result_t , ur_device_handle_t , POINTER (ur_device_partition_properties_t ), c_ulong , POINTER (ur_device_handle_t ), POINTER (c_ulong ) )
2811
2837
2812
2838
###############################################################################
2813
2839
## @brief Function-pointer for urDeviceSelectBinary
0 commit comments