@@ -46,7 +46,9 @@ from ._backend cimport ( # noqa: E211
46
46
DPCTLDevice_GetMaxReadImageArgs,
47
47
DPCTLDevice_GetMaxWorkGroupSize,
48
48
DPCTLDevice_GetMaxWorkItemDims,
49
- DPCTLDevice_GetMaxWorkItemSizes,
49
+ DPCTLDevice_GetMaxWorkItemSizes1d,
50
+ DPCTLDevice_GetMaxWorkItemSizes2d,
51
+ DPCTLDevice_GetMaxWorkItemSizes3d,
50
52
DPCTLDevice_GetMaxWriteImageArgs,
51
53
DPCTLDevice_GetName,
52
54
DPCTLDevice_GetParentDevice,
@@ -185,7 +187,7 @@ cdef void _init_helper(_SyclDevice device, DPCTLSyclDeviceRef DRef):
185
187
device._name = DPCTLDevice_GetName(DRef)
186
188
device._driver_version = DPCTLDevice_GetDriverVersion(DRef)
187
189
device._vendor = DPCTLDevice_GetVendor(DRef)
188
- device._max_work_item_sizes = DPCTLDevice_GetMaxWorkItemSizes (DRef)
190
+ device._max_work_item_sizes = DPCTLDevice_GetMaxWorkItemSizes3d (DRef)
189
191
190
192
191
193
cdef class SyclDevice(_SyclDevice):
@@ -263,7 +265,7 @@ cdef class SyclDevice(_SyclDevice):
263
265
self ._name = DPCTLDevice_GetName(self ._device_ref)
264
266
self ._driver_version = DPCTLDevice_GetDriverVersion(self ._device_ref)
265
267
self ._max_work_item_sizes = (
266
- DPCTLDevice_GetMaxWorkItemSizes (self ._device_ref)
268
+ DPCTLDevice_GetMaxWorkItemSizes3d (self ._device_ref)
267
269
)
268
270
self ._vendor = DPCTLDevice_GetVendor(self ._device_ref)
269
271
return 0
@@ -648,13 +650,61 @@ cdef class SyclDevice(_SyclDevice):
648
650
max_work_item_dims = DPCTLDevice_GetMaxWorkItemDims(self ._device_ref)
649
651
return max_work_item_dims
650
652
653
+ @property
654
+ def max_work_item_sizes1d (self ):
655
+ """ Returns the maximum number of work-items that are permitted in each
656
+ dimension of the work-group of the nd_range<1>. The minimum value is
657
+ `(1 )` for devices that are not of device type
658
+ ``info::device_type::custom``.
659
+ """
660
+ cdef size_t * max_work_item_sizes1d = NULL
661
+ max_work_item_sizes1d = DPCTLDevice_GetMaxWorkItemSizes1d(
662
+ self ._device_ref
663
+ )
664
+ res = (max_work_item_sizes1d[0 ], )
665
+ DPCTLSize_t_Array_Delete(max_work_item_sizes1d)
666
+ return res
667
+
668
+ @property
669
+ def max_work_item_sizes2d (self ):
670
+ """ Returns the maximum number of work-items that are permitted in each
671
+ dimension of the work-group of the nd_range<2>. The minimum value is
672
+ `(1; 1)` for devices that are not of device type
673
+ ``info::device_type::custom``.
674
+ """
675
+ cdef size_t * max_work_item_sizes2d = NULL
676
+ max_work_item_sizes2d = DPCTLDevice_GetMaxWorkItemSizes2d(
677
+ self ._device_ref
678
+ )
679
+ res = (max_work_item_sizes2d[0 ], max_work_item_sizes2d[1 ],)
680
+ DPCTLSize_t_Array_Delete(max_work_item_sizes2d)
681
+ return res
682
+
683
+ @property
684
+ def max_work_item_sizes3d (self ):
685
+ """ Returns the maximum number of work-items that are permitted in each
686
+ dimension of the work-group of the nd_range<3>. The minimum value is
687
+ `(1; 1; 1)` for devices that are not of device type
688
+ ``info::device_type::custom``.
689
+ """
690
+ return (
691
+ self ._max_work_item_sizes[0 ],
692
+ self ._max_work_item_sizes[1 ],
693
+ self ._max_work_item_sizes[2 ],
694
+ )
695
+
651
696
@property
652
697
def max_work_item_sizes (self ):
653
698
""" Returns the maximum number of work-items that are permitted in each
654
699
dimension of the work-group of the nd_range. The minimum value is
655
700
`(1; 1; 1)` for devices that are not of device type
656
701
``info::device_type::custom``.
657
702
"""
703
+ warnings.warn(
704
+ " dpctl.SyclDevice.max_work_item_sizes is deprecated, "
705
+ " use dpctl.SyclDevice.max_work_item_sizes3d instead" ,
706
+ DeprecationWarning ,
707
+ )
658
708
return (
659
709
self ._max_work_item_sizes[0 ],
660
710
self ._max_work_item_sizes[1 ],
0 commit comments