Skip to content

Commit

Permalink
Add test_full_cmplx128
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-pavlyk committed Aug 22, 2024
1 parent 2e73a6c commit f0d926a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dpctl/tests/test_usm_ndarray_ctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,27 @@ def test_full(dtype):
assert np.array_equal(dpt.asnumpy(X), np.full(10, 4, dtype=dtype))


def test_full_cmplx128():
q = get_queue_or_skip()
dtype = "c16"
skip_if_dtype_not_supported(dtype, q)
fill_v = 1 + 1j
X = dpt.full(tuple(), fill_value=fill_v, dtype=dtype, sycl_queue=q)
assert np.array_equal(
dpt.asnumpy(X), np.full(tuple(), fill_value=fill_v, dtype=dtype)
)
fill_v = 0 + 1j
X = dpt.full(tuple(), fill_value=fill_v, dtype=dtype, sycl_queue=q)
assert np.array_equal(
dpt.asnumpy(X), np.full(tuple(), fill_value=fill_v, dtype=dtype)
)
fill_v = 0 + 0j
X = dpt.full(tuple(), fill_value=fill_v, dtype=dtype, sycl_queue=q)
assert np.array_equal(
dpt.asnumpy(X), np.full(tuple(), fill_value=fill_v, dtype=dtype)
)


def test_full_dtype_inference():
try:
X = dpt.full(10, 4)
Expand Down

0 comments on commit f0d926a

Please sign in to comment.