Skip to content

Commit

Permalink
Add test for dpnp.empty() with dpjit queue arg
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzEeKkAa committed Oct 30, 2023
1 parent 324cdcc commit 45c189d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,22 @@ def func(shape, queue):
with pytest.raises(errors.TypingError):
queue = dpctl.SyclQueue()
func(10, queue)


def test_dpnp_empty_with_dpjit_queue():
"""Tests basic boxing and unboxing of a dpnp.ndarray object.
Checks if we can pass in and return a dpctl.ndarray object to and
from a dpjit decorated function.
"""

@dpjit
def func(a):
queue = a.sycl_queue
return dpnp.empty(10, sycl_queue=queue)

a = dpnp.empty(10)
b = func(a)

assert b is not None
assert b.sycl_queue is not None

0 comments on commit 45c189d

Please sign in to comment.