diff --git a/numba_dpex/tests/core/types/DpctlSyclQueue/test_box.py b/numba_dpex/tests/core/types/DpctlSyclQueue/test_box.py new file mode 100644 index 0000000000..5178043535 --- /dev/null +++ b/numba_dpex/tests/core/types/DpctlSyclQueue/test_box.py @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: 2020 - 2023 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +""" +Tests for boxing for dpnp.ndarray +""" + +import dpnp +from dpctl import SyclQueue + +from numba_dpex import dpjit + + +def test_boxing_without_parent(): + """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(arr): + queue = arr.sycl_queue + return queue + + arr = dpnp.empty(10) + + q = func(arr) + + assert q is not None + assert isinstance(q, SyclQueue) + assert id(q) != id(arr.sycl_queue)