Skip to content

Commit d2da805

Browse files
Merge pull request #876 from IntelPython/fix-intel-llvm-build-break
undefined
2 parents 09de29b + 81a14dc commit d2da805

File tree

9 files changed

+793
-884
lines changed

9 files changed

+793
-884
lines changed

dpctl/_backend.pxd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ cdef extern from "syclinterface/dpctl_sycl_device_interface.h":
157157
cdef uint32_t DPCTLDevice_GetMaxNumSubGroups(const DPCTLSyclDeviceRef DRef)
158158
cdef size_t DPCTLDevice_GetMaxWorkGroupSize(const DPCTLSyclDeviceRef DRef)
159159
cdef uint32_t DPCTLDevice_GetMaxWorkItemDims(const DPCTLSyclDeviceRef DRef)
160-
cdef size_t *DPCTLDevice_GetMaxWorkItemSizes(const DPCTLSyclDeviceRef DRef)
160+
cdef size_t *DPCTLDevice_GetMaxWorkItemSizes1d(const DPCTLSyclDeviceRef DRef)
161+
cdef size_t *DPCTLDevice_GetMaxWorkItemSizes2d(const DPCTLSyclDeviceRef DRef)
162+
cdef size_t *DPCTLDevice_GetMaxWorkItemSizes3d(const DPCTLSyclDeviceRef DRef)
161163
cdef const char *DPCTLDevice_GetName(const DPCTLSyclDeviceRef DRef)
162164
cdef DPCTLSyclPlatformRef DPCTLDevice_GetPlatform(
163165
const DPCTLSyclDeviceRef DRef)

dpctl/_sycl_device.pyx

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ from ._backend cimport ( # noqa: E211
4646
DPCTLDevice_GetMaxReadImageArgs,
4747
DPCTLDevice_GetMaxWorkGroupSize,
4848
DPCTLDevice_GetMaxWorkItemDims,
49-
DPCTLDevice_GetMaxWorkItemSizes,
49+
DPCTLDevice_GetMaxWorkItemSizes1d,
50+
DPCTLDevice_GetMaxWorkItemSizes2d,
51+
DPCTLDevice_GetMaxWorkItemSizes3d,
5052
DPCTLDevice_GetMaxWriteImageArgs,
5153
DPCTLDevice_GetName,
5254
DPCTLDevice_GetParentDevice,
@@ -185,7 +187,7 @@ cdef void _init_helper(_SyclDevice device, DPCTLSyclDeviceRef DRef):
185187
device._name = DPCTLDevice_GetName(DRef)
186188
device._driver_version = DPCTLDevice_GetDriverVersion(DRef)
187189
device._vendor = DPCTLDevice_GetVendor(DRef)
188-
device._max_work_item_sizes = DPCTLDevice_GetMaxWorkItemSizes(DRef)
190+
device._max_work_item_sizes = DPCTLDevice_GetMaxWorkItemSizes3d(DRef)
189191

190192

191193
cdef class SyclDevice(_SyclDevice):
@@ -263,7 +265,7 @@ cdef class SyclDevice(_SyclDevice):
263265
self._name = DPCTLDevice_GetName(self._device_ref)
264266
self._driver_version = DPCTLDevice_GetDriverVersion(self._device_ref)
265267
self._max_work_item_sizes = (
266-
DPCTLDevice_GetMaxWorkItemSizes(self._device_ref)
268+
DPCTLDevice_GetMaxWorkItemSizes3d(self._device_ref)
267269
)
268270
self._vendor = DPCTLDevice_GetVendor(self._device_ref)
269271
return 0
@@ -648,13 +650,61 @@ cdef class SyclDevice(_SyclDevice):
648650
max_work_item_dims = DPCTLDevice_GetMaxWorkItemDims(self._device_ref)
649651
return max_work_item_dims
650652

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+
651696
@property
652697
def max_work_item_sizes(self):
653698
""" Returns the maximum number of work-items that are permitted in each
654699
dimension of the work-group of the nd_range. The minimum value is
655700
`(1; 1; 1)` for devices that are not of device type
656701
``info::device_type::custom``.
657702
"""
703+
warnings.warn(
704+
"dpctl.SyclDevice.max_work_item_sizes is deprecated, "
705+
"use dpctl.SyclDevice.max_work_item_sizes3d instead",
706+
DeprecationWarning,
707+
)
658708
return (
659709
self._max_work_item_sizes[0],
660710
self._max_work_item_sizes[1],

0 commit comments

Comments
 (0)