Repository: IntelPython/dpnp (language: python)

Issue:
Implement dpnp.allclose() for a device without fp64 aspect
The PR proposes to provide support of `dpnp.allclose` function for a device without fp64 aspect.
Additionally, use cases with `nan` and `inf` values in input arrays are handling properly now.

- [x] Have you provided a meaningful PR description?
- [ ] Have you added a test, reproducer or referred to issue with a reproducer?
- [x] Have you tested your changes locally for CPU and GPU devices?
- [x] Have you made sure that new changes do not introduce compiler warnings?
- [ ] Have you checked performance impact of proposed changes?
- [ ] If this PR is a work in progress, are you filing the PR as a draft?



Discussion / hints:
<!-- add-pr-comment:add-pr-comment -->

View rendered docs @ https://intelpython.github.io/dpnp/index.html

Fix patch:
diff --git a/dpnp/backend/kernels/dpnp_krnl_logic.cpp b/dpnp/backend/kernels/dpnp_krnl_logic.cpp
index 2080306aead..429f9d96f1e 100644
--- a/dpnp/backend/kernels/dpnp_krnl_logic.cpp
+++ b/dpnp/backend/kernels/dpnp_krnl_logic.cpp
@@ -173,6 +173,28 @@ static sycl::event dpnp_allclose(sycl::queue &q,
                     partial &= (array1[i] == array2[i]);
                     continue;
                 }
+
+                // workaround for std::inf which does not work on CPU
+                // [CMPLRLLVM-51856]
+                if (array1[i] == std::numeric_limits<_DataType1>::infinity()) {
+                    partial &= (array1[i] == array2[i]);
+                    continue;
+                }
+                else if (array1[i] ==
+                         -std::numeric_limits<_DataType1>::infinity()) {
+                    partial &= (array1[i] == array2[i]);
+                    continue;
+                }
+                else if (array2[i] ==
+                         std::numeric_limits<_DataType2>::infinity()) {
+                    partial &= (array1[i] == array2[i]);
+                    continue;
+                }
+                else if (array2[i] ==
+                         -std::numeric_limits<_DataType2>::infinity()) {
+                    partial &= (array1[i] == array2[i]);
+                    continue;
+                }
             }
 
             // casting integeral to floating type to avoid bad behavior


Test patch:
diff --git a/tests/skipped_tests.tbl b/tests/skipped_tests.tbl
index 128b7f7f5da..9d82b93db88 100644
--- a/tests/skipped_tests.tbl
+++ b/tests/skipped_tests.tbl
@@ -72,12 +72,6 @@ tests/test_linalg.py::test_norm1[None-3-[7]]
 tests/test_linalg.py::test_norm1[None-3-[1, 2]]
 tests/test_linalg.py::test_norm1[None-3-[1, 0]]
 
-tests/test_logic.py::test_allclose[int32]
-tests/test_logic.py::test_allclose[int64]
-tests/test_logic.py::test_allclose[float32]
-tests/test_logic.py::test_allclose[float64]
-tests/test_logic.py::test_allclose[None]
-
 tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray([[i, i] for i in x])]
 tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: (dpnp.asarray([(i, i) for i in x], [("a", int), ("b", int)]).view(dpnp.recarray))]
 tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray([(i, i) for i in x], [("a", object), ("b", dpnp.int32)])]]