Skip to content

Commit 1008e30

Browse files
Exported dpctl.tensor.from_dlpack
Modified signature of dpctl.tensor.from_numpy renamed keyword argument queue to sycl_queue
1 parent 61da03f commit 1008e30

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

dpctl/tensor/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from dpctl.tensor._copy_utils import copy_to_numpy as asnumpy
3535
from dpctl.tensor._copy_utils import copy_to_numpy as to_numpy
3636
from dpctl.tensor._ctors import asarray, empty
37+
from dpctl.tensor._dlpack import from_dlpack
3738
from dpctl.tensor._reshape import reshape
3839
from dpctl.tensor._usmarray import usm_ndarray
3940

@@ -47,4 +48,5 @@
4748
"from_numpy",
4849
"to_numpy",
4950
"asnumpy",
51+
"from_dlpack",
5052
]

dpctl/tensor/_copy_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ def copy_to_numpy(ary):
9393
)
9494

9595

96-
def copy_from_numpy(np_ary, usm_type="device", queue=None):
96+
def copy_from_numpy(np_ary, usm_type="device", sycl_queue=None):
9797
"Copies numpy array `np_ary` into a new usm_ndarray"
9898
# This may peform a copy to meet stated requirements
9999
Xnp = np.require(np_ary, requirements=["A", "O", "C", "E"])
100-
if queue:
101-
ctor_kwargs = {"queue": queue}
100+
if sycl_queue:
101+
ctor_kwargs = {"queue": sycl_queue}
102102
else:
103103
ctor_kwargs = dict()
104104
Xusm = dpt.usm_ndarray(

dpctl/tests/test_tensor_asarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def test_asarray_copy_false():
163163
q = dpctl.SyclQueue()
164164
except dpctl.SyclQueueCreationError:
165165
pytest.skip("Could not create a queue")
166-
X = dpt.from_numpy(np.random.randn(10, 4), usm_type="device", queue=q)
166+
X = dpt.from_numpy(np.random.randn(10, 4), usm_type="device", sycl_queue=q)
167167
Y1 = dpt.asarray(X, copy=False, order="K")
168168
assert Y1 is X
169169
Y1c = dpt.asarray(X, copy=True, order="K")

0 commit comments

Comments
 (0)