fix test_compiler.py
@@ -82,11 +82,20 @@ class TestNvrtcArch(unittest.TestCase):
@testing.gpu
class TestNvrtcStderr(unittest.TestCase):
- def test(self):
+ @unittest.skipIf(cupy.cuda.runtime.is_hip,
+ 'HIPRTC has different error message')
+ def test1(self):
# An error message contains the file name `kern.cu`
with self.assertRaisesRegex(compiler.CompileException, 'kern.cu'):
compiler.compile_using_nvrtc('a')
+ @unittest.skipIf(not cupy.cuda.runtime.is_hip,
+ 'NVRTC has different error message')
+ def test2(self):
+ with self.assertRaises(compiler.CompileException) as e:
+ compiler.compile_using_nvrtc('a')
+ assert "unknown type name 'a'" in e
+
class TestIsValidKernelName(unittest.TestCase):
