Skip to content

Commit 797900d

Browse files
skip HIP tests if hip-python present but no HIP device
1 parent dbace7a commit 797900d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/context.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@
5555

5656
try:
5757
from hip import hip
58+
hip.hipDriverGetVersion()
5859
hip_present = True
59-
except ImportError:
60+
except (ImportError, RuntimeError):
6061
hip_present = False
6162

6263
skip_if_no_pycuda = pytest.mark.skipif(
@@ -78,7 +79,7 @@
7879
)
7980
skip_if_no_openmp = pytest.mark.skipif(not openmp_present, reason="No OpenMP found")
8081
skip_if_no_openacc = pytest.mark.skipif(not openacc_present, reason="No nvc++ on PATH")
81-
skip_if_no_hip = pytest.mark.skipif(not hip_present, reason="No HIP Python found")
82+
skip_if_no_hip = pytest.mark.skipif(not hip_present, reason="No HIP Python found or no HIP device detected")
8283

8384

8485
def skip_backend(backend: str):

0 commit comments

Comments
 (0)