Skip to content

Commit 661970f

Browse files
author
Diptorup Deb
committed
More docstring updates
1 parent 7d8e770 commit 661970f

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

dpctl/_sycl_device.pyx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ from ._sycl_platform cimport SyclPlatform
103103

104104
import collections
105105
import warnings
106+
from typing import Tuple
106107

107108
__all__ = [
108109
"SyclDevice", "SyclDeviceCreationError", "SyclSubDeviceCreationError",
@@ -737,17 +738,24 @@ cdef class SyclDevice(_SyclDevice):
737738
def max_work_item_dims(self):
738739
""" Returns the maximum dimensions that specify the global and local
739740
work-item IDs used by the data parallel execution model.
741+
742+
Returns:
743+
int: The maximum number of work items supported by the device.
740744
"""
741745
cdef uint32_t max_work_item_dims = 0
742746
max_work_item_dims = DPCTLDevice_GetMaxWorkItemDims(self._device_ref)
743747
return max_work_item_dims
744748

745749
@property
746-
def max_work_item_sizes1d(self):
750+
def max_work_item_sizes1d(self) -> Tuple[int,]:
747751
""" Returns the maximum number of work-items that are permitted in each
748752
dimension of the work-group of the nd_range<1>. The minimum value is
749-
`(1 )` for devices that are not of device type
750-
``info::device_type::custom``.
753+
`(1 )` for devices that evaluate to False for
754+
:py:attr:`~has_aspect_custom`.
755+
756+
Returns:
757+
A tuple with the maximum allowed value for a 1D range used to
758+
enqueue a kernel on the device.
751759
"""
752760
cdef size_t *max_work_item_sizes1d = NULL
753761
max_work_item_sizes1d = DPCTLDevice_GetMaxWorkItemSizes1d(
@@ -758,11 +766,15 @@ cdef class SyclDevice(_SyclDevice):
758766
return res
759767

760768
@property
761-
def max_work_item_sizes2d(self):
769+
def max_work_item_sizes2d(self) -> Tuple[int, int]:
762770
""" Returns the maximum number of work-items that are permitted in each
763771
dimension of the work-group of the nd_range<2>. The minimum value is
764-
`(1; 1)` for devices that are not of device type
765-
``info::device_type::custom``.
772+
`(1; 1)` for devices that evaluate to False for
773+
:py:attr:`~has_aspect_custom`.
774+
775+
Returns:
776+
A tuple with the maximum allowed value for each dimension of a 2D
777+
range used to enqueue a kernel on the device.
766778
"""
767779
cdef size_t *max_work_item_sizes2d = NULL
768780
max_work_item_sizes2d = DPCTLDevice_GetMaxWorkItemSizes2d(
@@ -773,7 +785,7 @@ cdef class SyclDevice(_SyclDevice):
773785
return res
774786

775787
@property
776-
def max_work_item_sizes3d(self):
788+
def max_work_item_sizes3d(self) -> Tuple[int, int]:
777789
""" Returns the maximum number of work-items that are permitted in each
778790
dimension of the work-group of the nd_range<3>. The minimum value is
779791
`(1; 1; 1)` for devices that are not of device type

0 commit comments

Comments
 (0)