File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ cdef extern from "syclinterface/dpctl_sycl_device_interface.h":
206
206
const DPCTLSyclDeviceRef DRef)
207
207
cdef size_t * DPCTLDevice_GetSubGroupSizes(const DPCTLSyclDeviceRef DRef,
208
208
size_t * res_len)
209
+ cdef uint32_t DPCTLDevice_GetPartitionMaxSubDevices(const DPCTLSyclDeviceRef DRef)
209
210
210
211
211
212
cdef extern from " syclinterface/dpctl_sycl_device_manager.h" :
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ from ._backend cimport ( # noqa: E211
55
55
DPCTLDevice_GetMaxWriteImageArgs,
56
56
DPCTLDevice_GetName,
57
57
DPCTLDevice_GetParentDevice,
58
+ DPCTLDevice_GetPartitionMaxSubDevices,
58
59
DPCTLDevice_GetPlatform,
59
60
DPCTLDevice_GetPreferredVectorWidthChar,
60
61
DPCTLDevice_GetPreferredVectorWidthDouble,
@@ -1292,9 +1293,25 @@ cdef class SyclDevice(_SyclDevice):
1292
1293
"""
1293
1294
cdef uint64_t cache_line_sz = DPCTLDevice_GetGlobalMemCacheLineSize(
1294
1295
self ._device_ref
1295
- )
1296
+ )
1296
1297
return cache_line_sz
1297
1298
1299
+ @property
1300
+ def partition_max_sub_devices (self ):
1301
+ """ The maximum number of sub-devices this :class:`dpctl.SyclDevice`
1302
+ instance can be partitioned into. The value returned cannot exceed the
1303
+ value returned by :attr:`dpctl.SyclDevice.max_compute_units`.
1304
+
1305
+ Returns:
1306
+ int: The maximum number of sub-devices that can be created when this
1307
+ device is partitioned. Zero value indicates that device can not
1308
+ be partitioned.
1309
+ """
1310
+ cdef uint32_t max_part = DPCTLDevice_GetPartitionMaxSubDevices(
1311
+ self ._device_ref
1312
+ )
1313
+ return max_part
1314
+
1298
1315
cdef cpp_bool equals(self , SyclDevice other):
1299
1316
""" Returns ``True`` if the :class:`dpctl.SyclDevice` argument has the
1300
1317
same _device_ref as this SyclDevice.
Original file line number Diff line number Diff line change @@ -540,6 +540,13 @@ def check_parent_device(device):
540
540
assert pd is None or isinstance (pd , dpctl .SyclDevice )
541
541
542
542
543
+ def check_partition_max_sub_devices (device ):
544
+ max_part = device .partition_max_sub_devices
545
+ assert isinstance (max_part , int )
546
+ assert max_part >= 0
547
+ assert max_part <= device .max_compute_units
548
+
549
+
543
550
def check_filter_string (device ):
544
551
try :
545
552
fs = device .filter_string
@@ -670,6 +677,7 @@ def check_global_mem_cache_line_size(device):
670
677
check_profiling_timer_resolution ,
671
678
check_platform ,
672
679
check_parent_device ,
680
+ check_partition_max_sub_devices ,
673
681
check_filter_string ,
674
682
check_vendor ,
675
683
check_driver_version ,
You can’t perform that action at this time.
0 commit comments