add python unit test for GPU capabilities

This commit is contained in:
Axel Kohlmeyer 2021-05-11 15:17:43 -04:00
parent 228711f59b
commit fbe9240cf3
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 9 additions and 0 deletions

View File

@ -158,5 +158,14 @@ class PythonCapabilities(unittest.TestCase):
if self.cmake_cache['GPU_PREC'].lower() == 'single':
self.assertIn('single',settings['GPU']['precision'])
def test_gpu_device(self):
info = self.lmp.get_gpu_device_info()
if self.lmp.has_gpu_device:
self.assertTrue(info)
self.assertGreaterEqual(info.find("Device"),0)
else:
self.assertFalse(info)
if __name__ == "__main__":
unittest.main()