Skip to content

Commit 79f4041

Browse files
Merge pull request #1276 from IntelPython/fix-proj
Fix failure of proj to JIT-compile associated kernel on HW without fp64-support
2 parents f756c41 + 4dfa3ac commit 79f4041

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dpctl/tensor/libtensor/include/kernels/elementwise_functions/proj.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ template <typename argT, typename resT> struct ProjFunctor
7272
const realT y = std::imag(in);
7373

7474
if (std::isinf(x) || std::isinf(y)) {
75-
const realT res_im = std::copysign(0.0, y);
75+
const realT res_im = std::copysign(realT(0), y);
7676
return resT{std::numeric_limits<realT>::infinity(), res_im};
7777
}
7878
return in;

dpctl/tests/elementwise/test_complex.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ def test_complex_output(np_call, dpt_call, dtype):
5959
x1 = np.linspace(0, 10, num=n_seq, dtype=dtype)
6060
x2 = np.linspace(0, 20, num=n_seq, dtype=dtype)
6161
Xnp = x1 + 1j * x2
62-
X = dpt.asarray(Xnp, dtype=Xnp.dtype, sycl_queue=q)
62+
X = dpt.asarray(Xnp, sycl_queue=q)
6363

6464
Y = dpt_call(X)
6565
tol = 8 * dpt.finfo(Y.dtype).resolution
6666

6767
assert_allclose(dpt.asnumpy(Y), np_call(Xnp), atol=tol, rtol=tol)
6868

69-
Z = dpt.empty_like(X, dtype=np_call(Xnp).dtype)
69+
Z = dpt.empty_like(X, dtype=Y.dtype)
7070
dpt_call(X, out=Z)
7171

7272
assert_allclose(dpt.asnumpy(Z), np_call(Xnp), atol=tol, rtol=tol)

0 commit comments

Comments
 (0)