Skip to content

Commit

Permalink
Add SyclQueue boxing without parent test
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzEeKkAa committed Oct 30, 2023
1 parent d736dcb commit 91e6a57
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions numba_dpex/tests/core/types/DpctlSyclQueue/test_box.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 91e6a57

Please sign in to comment.