Fix to check HIP version
@@ -15,6 +15,7 @@ class TestCheckVersion(unittest.TestCase):
self.settings = build.get_compiler_setting(False)
@pytest.mark.gpu
+ @pytest.mark.skipIf(build.use_hip, reason='For CUDA environment')
def test_check_cuda_version(self):
with self.assertRaises(RuntimeError):
build.get_cuda_version()
@@ -23,6 +24,16 @@ class TestCheckVersion(unittest.TestCase):
assert isinstance(build.get_cuda_version(), int)
assert isinstance(build.get_cuda_version(True), str)
+ @pytest.mark.gpu
+ @pytest.mark.skipIf(not build.use_hip, reason='For ROCm/HIP environment')
+ def test_check_hip_version(self):
+ with self.assertRaises(RuntimeError):
+ build.get_hip_version()
+ assert build.check_hip_version(
+ self.compiler, self.settings)
+ assert isinstance(build.get_hip_version(), int)
+ assert isinstance(build.get_hip_version(True), str)
+
@pytest.mark.gpu
@pytest.mark.cudnn
@pytest.mark.xfail(build.use_hip,
