add Device.attributes test case
@@ -4,6 +4,7 @@ import pytest
import six
from cupy import cuda
+from cupy import testing
class TestDeviceComparison(unittest.TestCase):
@@ -74,3 +75,15 @@ class TestDeviceComparison(unittest.TestCase):
self.check_comparison_other_type(cuda.Device(1), 0)
self.check_comparison_other_type(cuda.Device(1), None)
self.check_comparison_other_type(cuda.Device(1), object())
+
+
+@testing.gpu
+class TestDeviceAttributes(unittest.TestCase):
+
+ def test_device_attributes(self):
+ d = cuda.Device()
+ attributes = d.attributes
+ assert isinstance(attributes, dict)
+ assert all(isinstance(a, int) for a in attributes.values())
+ # test a specific attribute that would be present on any supported GPU
+ assert 'MaxThreadsPerBlock' in attributes
