Skip to content

Commit 38b0c4f

Browse files
authored
Removed absolete TODO from (#1605)
1 parent f58d19d commit 38b0c4f

File tree

1 file changed

+33
-28
lines changed

1 file changed

+33
-28
lines changed

dpnp/dpnp_iface.py

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -366,37 +366,45 @@ def get_normalized_queue_device(obj=None, device=None, sycl_queue=None):
366366
Utility to process complementary keyword arguments 'device' and 'sycl_queue'
367367
in subsequent calls of functions from `dpctl.tensor` module.
368368
369-
If both arguments 'device' and 'sycl_queue' have default value `None`
369+
If both arguments 'device' and 'sycl_queue' have default value ``None``
370370
and 'obj' has `sycl_queue` attribute, it assumes that Compute Follows Data
371371
approach has to be applied and so the resulting SYCL queue will be normalized
372372
based on the queue value from 'obj'.
373373
374-
Args:
375-
obj (optional): A python object. Can be an instance of `dpnp_array`,
376-
`dpctl.tensor.usm_ndarray`, an object representing SYCL USM allocation
377-
and implementing `__sycl_usm_array_interface__` protocol,
378-
an instance of `numpy.ndarray`, an object supporting Python buffer protocol,
379-
a Python scalar, or a (possibly nested) sequence of Python scalars.
380-
sycl_queue (:class:`dpctl.SyclQueue`, optional):
381-
explicitly indicates where USM allocation is done
382-
and the population code (if any) is executed.
383-
Value `None` is interpreted as get the SYCL queue
384-
from `obj` parameter if not None, from `device` keyword,
385-
or use default queue.
386-
Default: None
387-
device (string, :class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue,
388-
:class:`dpctl.tensor.Device`, optional):
389-
array-API keyword indicating non-partitioned SYCL device
390-
where array is allocated.
374+
Parameters
375+
----------
376+
obj : object, optional
377+
A python object. Can be an instance of `dpnp_array`,
378+
`dpctl.tensor.usm_ndarray`, an object representing SYCL USM allocation
379+
and implementing `__sycl_usm_array_interface__` protocol, an instance
380+
of `numpy.ndarray`, an object supporting Python buffer protocol,
381+
a Python scalar, or a (possibly nested) sequence of Python scalars.
382+
sycl_queue : class:`dpctl.SyclQueue`, optional
383+
A queue which explicitly indicates where USM allocation is done
384+
and the population code (if any) is executed.
385+
Value ``None`` is interpreted as to get the SYCL queue from either
386+
`obj` parameter if not ``None`` or from `device` keyword,
387+
or to use default queue.
388+
device : {string, :class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue,
389+
:class:`dpctl.tensor.Device`}, optional
390+
An array-API keyword indicating non-partitioned SYCL device
391+
where array is allocated.
392+
391393
Returns
392-
:class:`dpctl.SyclQueue` object normalized by `normalize_queue_device` call
394+
-------
395+
sycl_queue: dpctl.SyclQueue
396+
A :class:`dpctl.SyclQueue` object normalized by `normalize_queue_device` call
393397
of `dpctl.tensor` module invoked with 'device' and 'sycl_queue' values.
394398
If both incoming 'device' and 'sycl_queue' are None and 'obj' has `sycl_queue` attribute,
395399
the normalization will be performed for 'obj.sycl_queue' value.
396-
Raises:
397-
TypeError: if argument is not of the expected type, or keywords
398-
imply incompatible queues.
400+
401+
Raises
402+
------
403+
TypeError
404+
If argument is not of the expected type, or keywords imply incompatible queues.
405+
399406
"""
407+
400408
if (
401409
device is None
402410
and sycl_queue is None
@@ -405,12 +413,9 @@ def get_normalized_queue_device(obj=None, device=None, sycl_queue=None):
405413
):
406414
sycl_queue = obj.sycl_queue
407415

408-
# TODO: remove check dpt._device has attribute 'normalize_queue_device'
409-
if hasattr(dpt._device, "normalize_queue_device"):
410-
return dpt._device.normalize_queue_device(
411-
sycl_queue=sycl_queue, device=device
412-
)
413-
return sycl_queue
416+
return dpt._device.normalize_queue_device(
417+
sycl_queue=sycl_queue, device=device
418+
)
414419

415420

416421
def get_usm_ndarray(a):

0 commit comments

Comments
 (0)