Add test for get method
@@ -7,6 +7,7 @@ import tempfile
import unittest
+import cupy
from cupy import testing
@@ -81,6 +82,17 @@ class TestNotAvailable(unittest.TestCase):
self.assertFalse(available)
+class TestMemoryPool(unittest.TestCase):
+
+ def test_get_default_memory_pool(self):
+ p = cupy.get_default_memory_pool()
+ self.assertIsInstance(p, cupy.cuda.memory.MemoryPool)
+
+ def test_get_default_pinned_memory_pool(self):
+ p = cupy.get_default_pinned_memory_pool()
+ self.assertIsInstance(p, cupy.cuda.pinned_memory.PinnedMemoryPool)
+
+
# This is copied from chainer/testing/__init__.py, so should be replaced in
# some way.
if __name__ == '__main__':
