From bea14e7438afd2d958df0191109f791df1476897 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Fri, 29 Nov 2024 20:51:08 +0100 Subject: [PATCH] TBD --- .../third_party/cupy/core_tests/test_core.py | 3 +++ .../cupy/core_tests/test_elementwise.py | 20 +++++++++++++++---- .../third_party/cupy/core_tests/test_flags.py | 2 ++ .../cupy/core_tests/test_include.py | 3 ++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/dpnp/tests/third_party/cupy/core_tests/test_core.py b/dpnp/tests/third_party/cupy/core_tests/test_core.py index 36b8fc34033..bf0cbecb24c 100644 --- a/dpnp/tests/third_party/cupy/core_tests/test_core.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_core.py @@ -9,6 +9,7 @@ class TestSize(unittest.TestCase): + # def tearDown(self): # # Free huge memory for slow test # cupy.get_default_memory_pool().free_all_blocks() @@ -51,6 +52,7 @@ def test_size_huge(self, xp): @pytest.mark.skip("no cupy._core submodule") class TestOrder(unittest.TestCase): + @testing.for_orders(_orders.keys()) def test_ndarray(self, order): order_expect = _orders[order] @@ -101,6 +103,7 @@ def test_cupy_ndarray(self, dtype): ) @pytest.mark.skip("compiling cupy headers are not supported") class TestCuPyHeaders(unittest.TestCase): + def setUp(self): self.temporary_cache_dir_context = test_raw.use_temporary_cache_dir() self.cache_dir = self.temporary_cache_dir_context.__enter__() diff --git a/dpnp/tests/third_party/cupy/core_tests/test_elementwise.py b/dpnp/tests/third_party/cupy/core_tests/test_elementwise.py index 10cff60a730..2d268e53b37 100644 --- a/dpnp/tests/third_party/cupy/core_tests/test_elementwise.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_elementwise.py @@ -119,7 +119,10 @@ def test_large_int_upper_3(self, xp, dtype): and numpy.lib.NumpyVersion(numpy.__version__) < "2.0.0" ): pytest.skip("numpy promotes dtype differently") - elif dtype == numpy.uint64 and not has_support_aspect64(): + elif ( + dtype in (numpy.uint64, numpy.ulonglong) + and not has_support_aspect64() + ): pytest.skip("no fp64 support") a = xp.array([xp.iinfo(dtype).max], dtype=dtype) @@ -134,7 +137,10 @@ def test_large_int_upper_4(self, xp, dtype): and numpy.lib.NumpyVersion(numpy.__version__) < "2.0.0" ): pytest.skip("numpy promotes dtype differently") - elif dtype == numpy.uint64 and not has_support_aspect64(): + elif ( + dtype in (numpy.uint64, numpy.ulonglong) + and not has_support_aspect64() + ): pytest.skip("no fp64 support") a = xp.array([xp.iinfo(dtype).max - 1], dtype=dtype) @@ -163,7 +169,10 @@ def test_large_int_lower_3(self, xp, dtype): and numpy.lib.NumpyVersion(numpy.__version__) < "2.0.0" ): pytest.skip("numpy promotes dtype differently") - elif dtype == numpy.uint64 and not has_support_aspect64(): + elif ( + dtype in (numpy.uint64, numpy.ulonglong) + and not has_support_aspect64() + ): pytest.skip("no fp64 support") a = xp.array([xp.iinfo(dtype).min], dtype=dtype) @@ -173,7 +182,10 @@ def test_large_int_lower_3(self, xp, dtype): @testing.for_int_dtypes(no_bool=True) @testing.numpy_cupy_array_equal() def test_large_int_lower_4(self, xp, dtype): - if dtype == numpy.uint64 and not has_support_aspect64(): + if ( + dtype in (numpy.uint64, numpy.ulonglong) + and not has_support_aspect64() + ): pytest.skip("no fp64 support") a = xp.array([xp.iinfo(dtype).min + 1], dtype=dtype) diff --git a/dpnp/tests/third_party/cupy/core_tests/test_flags.py b/dpnp/tests/third_party/cupy/core_tests/test_flags.py index 9dbccfbf0c4..b2cc4fca59f 100644 --- a/dpnp/tests/third_party/cupy/core_tests/test_flags.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_flags.py @@ -9,6 +9,7 @@ @pytest.mark.skip("class Flags is not exposed") class TestFlags(unittest.TestCase): + def setUp(self): self.flags = flags.Flags(1, 2, 3) @@ -42,6 +43,7 @@ def test_repr(self): ) ) class TestContiguityFlags(unittest.TestCase): + def setUp(self): self.flags = None diff --git a/dpnp/tests/third_party/cupy/core_tests/test_include.py b/dpnp/tests/third_party/cupy/core_tests/test_include.py index 7fd7e9ed17e..1119b13914e 100644 --- a/dpnp/tests/third_party/cupy/core_tests/test_include.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_include.py @@ -1,9 +1,10 @@ import os from unittest import mock -import cupy import pytest +import dpnp as cupy + pytest.skip("CUDA compile is not supported", allow_module_level=True) _code_base = """