Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions dpnp/dpnp_utils/dpnp_algo_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,6 @@ cdef tuple get_common_usm_allocation(dpnp_descriptor x1, dpnp_descriptor x2):
"".format(array1_obj.usm_type, array2_obj.usm_type))

common_sycl_queue = dpu.get_execution_queue((array1_obj.sycl_queue, array2_obj.sycl_queue))
# TODO: refactor, remove when CFD is implemented in all array constructors
if common_sycl_queue is None and array1_obj.sycl_context == array2_obj.sycl_context:
common_sycl_queue = array1_obj.sycl_queue
if common_sycl_queue is None:
raise ValueError(
"could not recognize common SYCL queue for inputs in SYCL queues {} and {}"
Expand Down
16 changes: 15 additions & 1 deletion tests/test_sycl_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import numpy

from numpy.testing import (
assert_array_equal
assert_array_equal,
assert_raises
)


Expand Down Expand Up @@ -353,6 +354,19 @@ def test_broadcasting(func, data1, data2, device):
assert_sycl_queue_equal(result_queue, expected_queue)


@pytest.mark.parametrize("func", ["add", "copysign", "divide", "floor_divide", "fmod",
"maximum", "minimum", "multiply", "outer", "power",
"remainder", "subtract"])
@pytest.mark.parametrize("device",
valid_devices,
ids=[device.filter_string for device in valid_devices])
def test_2in_1out_diff_queue_but_equal_context(func, device):
x1 = dpnp.arange(10)
x2 = dpnp.arange(10, sycl_queue=dpctl.SyclQueue(device))[::-1]
with assert_raises(ValueError):
getattr(dpnp, func)(x1, x2)


@pytest.mark.parametrize(
"func, kwargs",
[
Expand Down