|
| 1 | +from __future__ import annotations |
| 2 | + |
1 | 3 | import unittest
|
2 | 4 |
|
3 | 5 | import numpy
|
|
8 | 10 |
|
9 | 11 | # from cupy.cuda import runtime
|
10 | 12 |
|
11 |
| -pytest.skip("dpnp.vectorize is not implemented", allow_module_level=True) |
| 13 | + |
| 14 | +# def _rocm_version_major(): |
| 15 | +# if not getattr(runtime, "is_hip", False): |
| 16 | +# return -1 |
| 17 | + |
| 18 | +# version = runtime.runtimeGetVersion() |
| 19 | +# major = version // 10_000_000 |
| 20 | +# return int(major) |
| 21 | + |
| 22 | + |
| 23 | +# _ROCM_VER_MAJOR = _rocm_version_major() |
| 24 | +# _IS_HIP_LT7 = bool(_ROCM_VER_MAJOR != -1 and int(_ROCM_VER_MAJOR) < 7) |
12 | 25 |
|
13 | 26 |
|
| 27 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
14 | 28 | class TestVectorizeOps(unittest.TestCase):
|
15 | 29 |
|
16 | 30 | def _run(self, func, xp, dtypes):
|
@@ -225,6 +239,7 @@ def my_usub(x):
|
225 | 239 | return self._run(my_usub, xp, [dtype])
|
226 | 240 |
|
227 | 241 |
|
| 242 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
228 | 243 | class TestVectorizeExprs(unittest.TestCase):
|
229 | 244 |
|
230 | 245 | @testing.for_all_dtypes(name="cond_dtype", no_complex=True)
|
@@ -293,6 +308,7 @@ def my_typecast(x):
|
293 | 308 | return f(x)
|
294 | 309 |
|
295 | 310 |
|
| 311 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
296 | 312 | class TestVectorizeInstructions(unittest.TestCase):
|
297 | 313 |
|
298 | 314 | @testing.for_all_dtypes()
|
@@ -371,6 +387,7 @@ def my_nonconst_result(x):
|
371 | 387 | return f(x)
|
372 | 388 |
|
373 | 389 |
|
| 390 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
374 | 391 | class TestVectorizeStmts(unittest.TestCase):
|
375 | 392 |
|
376 | 393 | @testing.numpy_cupy_array_equal()
|
@@ -567,6 +584,7 @@ def __init__(self, x):
|
567 | 584 | self.x = x
|
568 | 585 |
|
569 | 586 |
|
| 587 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
570 | 588 | class TestVectorizeConstants(unittest.TestCase):
|
571 | 589 |
|
572 | 590 | @testing.numpy_cupy_array_equal()
|
@@ -594,6 +612,7 @@ def my_func(x1, x2):
|
594 | 612 | return f(x1, x2)
|
595 | 613 |
|
596 | 614 |
|
| 615 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
597 | 616 | class TestVectorizeBroadcast(unittest.TestCase):
|
598 | 617 |
|
599 | 618 | @testing.for_all_dtypes(no_bool=True)
|
@@ -630,6 +649,7 @@ def my_func(x1, x2):
|
630 | 649 | return f(x1, x2)
|
631 | 650 |
|
632 | 651 |
|
| 652 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
633 | 653 | class TestVectorize(unittest.TestCase):
|
634 | 654 |
|
635 | 655 | @testing.for_all_dtypes(no_bool=True)
|
|
0 commit comments