Skip to content

Commit b316e6f

Browse files
committed
Add small updates in the thrid party tests to reduce diff to the latest content
1 parent 738df73 commit b316e6f

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

dpnp/tests/third_party/cupy/core_tests/test_core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import sys
24
import unittest
35

@@ -97,7 +99,7 @@ def test_cupy_ndarray(self, dtype):
9799
@testing.parameterize(
98100
*testing.product(
99101
{
100-
"cxx": (None, "--std=c++11"),
102+
"cxx": (None, "--std=c++14"),
101103
}
102104
)
103105
)

dpnp/tests/third_party/cupy/core_tests/test_function.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
from __future__ import annotations
2+
13
import unittest
24

3-
import numpy
45
import pytest
56

67
import dpnp as cupy
@@ -18,9 +19,7 @@
1819
def _compile_func(kernel_name, code):
1920
# workaround for hipRTC
2021
extra_source = core._get_header_source() if runtime.is_hip else None
21-
mod = compiler._compile_module_with_cache(
22-
code, options=("--std=c++11",), extra_source=extra_source
23-
)
22+
mod = compiler._compile_module_with_cache(code, extra_source=extra_source)
2423
return mod.get_function(kernel_name)
2524

2625

dpnp/tests/third_party/cupy/functional_tests/test_vectorize.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import unittest
24

35
import numpy
@@ -8,9 +10,21 @@
810

911
# from cupy.cuda import runtime
1012

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)
1225

1326

27+
# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).")
1428
class TestVectorizeOps(unittest.TestCase):
1529

1630
def _run(self, func, xp, dtypes):
@@ -225,6 +239,7 @@ def my_usub(x):
225239
return self._run(my_usub, xp, [dtype])
226240

227241

242+
# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).")
228243
class TestVectorizeExprs(unittest.TestCase):
229244

230245
@testing.for_all_dtypes(name="cond_dtype", no_complex=True)
@@ -293,6 +308,7 @@ def my_typecast(x):
293308
return f(x)
294309

295310

311+
# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).")
296312
class TestVectorizeInstructions(unittest.TestCase):
297313

298314
@testing.for_all_dtypes()
@@ -371,6 +387,7 @@ def my_nonconst_result(x):
371387
return f(x)
372388

373389

390+
# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).")
374391
class TestVectorizeStmts(unittest.TestCase):
375392

376393
@testing.numpy_cupy_array_equal()
@@ -567,6 +584,7 @@ def __init__(self, x):
567584
self.x = x
568585

569586

587+
# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).")
570588
class TestVectorizeConstants(unittest.TestCase):
571589

572590
@testing.numpy_cupy_array_equal()
@@ -594,6 +612,7 @@ def my_func(x1, x2):
594612
return f(x1, x2)
595613

596614

615+
# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).")
597616
class TestVectorizeBroadcast(unittest.TestCase):
598617

599618
@testing.for_all_dtypes(no_bool=True)
@@ -630,6 +649,7 @@ def my_func(x1, x2):
630649
return f(x1, x2)
631650

632651

652+
# @pytest.mark.skipif(_IS_HIP_LT7, reason="Skip on ROCm < 7 (HIP).")
633653
class TestVectorize(unittest.TestCase):
634654

635655
@testing.for_all_dtypes(no_bool=True)

0 commit comments

Comments
 (0)