|
| 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 |
|
| 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) |
| 25 | + |
| 26 | + |
11 | 27 | pytest.skip("dpnp.vectorize is not implemented", allow_module_level=True) |
12 | 28 |
|
13 | 29 |
|
| 30 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
14 | 31 | class TestVectorizeOps(unittest.TestCase): |
15 | 32 |
|
16 | 33 | def _run(self, func, xp, dtypes): |
@@ -225,6 +242,7 @@ def my_usub(x): |
225 | 242 | return self._run(my_usub, xp, [dtype]) |
226 | 243 |
|
227 | 244 |
|
| 245 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
228 | 246 | class TestVectorizeExprs(unittest.TestCase): |
229 | 247 |
|
230 | 248 | @testing.for_all_dtypes(name="cond_dtype", no_complex=True) |
@@ -293,6 +311,7 @@ def my_typecast(x): |
293 | 311 | return f(x) |
294 | 312 |
|
295 | 313 |
|
| 314 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
296 | 315 | class TestVectorizeInstructions(unittest.TestCase): |
297 | 316 |
|
298 | 317 | @testing.for_all_dtypes() |
@@ -371,6 +390,7 @@ def my_nonconst_result(x): |
371 | 390 | return f(x) |
372 | 391 |
|
373 | 392 |
|
| 393 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
374 | 394 | class TestVectorizeStmts(unittest.TestCase): |
375 | 395 |
|
376 | 396 | @testing.numpy_cupy_array_equal() |
@@ -567,6 +587,7 @@ def __init__(self, x): |
567 | 587 | self.x = x |
568 | 588 |
|
569 | 589 |
|
| 590 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
570 | 591 | class TestVectorizeConstants(unittest.TestCase): |
571 | 592 |
|
572 | 593 | @testing.numpy_cupy_array_equal() |
@@ -594,6 +615,7 @@ def my_func(x1, x2): |
594 | 615 | return f(x1, x2) |
595 | 616 |
|
596 | 617 |
|
| 618 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
597 | 619 | class TestVectorizeBroadcast(unittest.TestCase): |
598 | 620 |
|
599 | 621 | @testing.for_all_dtypes(no_bool=True) |
@@ -630,6 +652,7 @@ def my_func(x1, x2): |
630 | 652 | return f(x1, x2) |
631 | 653 |
|
632 | 654 |
|
| 655 | +# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).") |
633 | 656 | class TestVectorize(unittest.TestCase): |
634 | 657 |
|
635 | 658 | @testing.for_all_dtypes(no_bool=True) |
|
0 commit comments