Skip to content

Using device or sycl_queue keyword, not both #1147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dpnp/dpnp_algo/dpnp_algo_linearalgebra.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ cpdef utils.dpnp_descriptor dpnp_matmul(utils.dpnp_descriptor in_array1, utils.d
cdef utils.dpnp_descriptor result = utils.create_output_descriptor(shape_result,
kernel_data.return_type,
out,
device=result_sycl_device,
device=None,
usm_type=result_usm_type,
sycl_queue=result_sycl_queue)
if result.size == 0:
Expand Down
6 changes: 1 addition & 5 deletions dpnp/dpnp_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,8 @@ def __init__(self,
"".format(shape, buffer.shape)
)
self._array_obj = dpt.asarray(buffer,
dtype=buffer.dtype,
copy=False,
order=order,
device=buffer.sycl_device,
usm_type=buffer.usm_type,
sycl_queue=buffer.sycl_queue)
order=order)
else:
sycl_queue_normalized = normalize_queue_device(sycl_queue=sycl_queue, device=device)
self._array_obj = dpt.usm_ndarray(shape,
Expand Down
11 changes: 6 additions & 5 deletions dpnp/dpnp_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import numpy

import dpctl.tensor as dpt

from dpctl.tensor._device import normalize_queue_device

if config.__DPNP_OUTPUT_DPCTL__:
try:
Expand Down Expand Up @@ -76,13 +76,13 @@ def asarray(x1,
else:
x1_obj = x1

sycl_queue_normalized = normalize_queue_device(sycl_queue=sycl_queue, device=device)
array_obj = dpt.asarray(x1_obj,
dtype=dtype,
copy=copy,
order=order,
device=device,
usm_type=usm_type,
sycl_queue=sycl_queue)
sycl_queue=sycl_queue_normalized)

return dpnp_array(array_obj.shape, buffer=array_obj, order=order)

Expand All @@ -94,11 +94,12 @@ def empty(shape,
usm_type="device",
sycl_queue=None):
"""Creates `dpnp_array` from uninitialized USM allocation."""
sycl_queue_normalized = normalize_queue_device(sycl_queue=sycl_queue, device=device)

array_obj = dpt.empty(shape,
dtype=dtype,
order=order,
device=device,
usm_type=usm_type,
sycl_queue=sycl_queue)
sycl_queue=sycl_queue_normalized)

return dpnp_array(array_obj.shape, buffer=array_obj, order=order)