fix wrong skip condition for TestUnownedMemory async tests
@@ -10,6 +10,7 @@ import pytest
import cupy.cuda
from cupy.cuda import device
from cupy.cuda import memory
+from cupy.cuda import runtime
from cupy.cuda import stream as stream_module
from cupy import testing
@@ -59,6 +60,7 @@ class TestUnownedMemory(unittest.TestCase):
if self.allocator is memory.malloc_async:
raise unittest.SkipTest('HIP does not support async mempool')
else:
+ if self.allocator is memory.malloc_async:
if cupy.cuda.driver._is_cuda_python():
version = cupy.cuda.runtime.runtimeGetVersion()
else:
@@ -66,6 +68,10 @@ class TestUnownedMemory(unittest.TestCase):
if version < 11020:
raise unittest.SkipTest('malloc_async is supported since '
'CUDA 11.2')
+ elif runtime.deviceGetAttribute(
+ runtime.cudaDevAttrMemoryPoolsSupported, 0) == 0:
+ raise unittest.SkipTest(
+ 'malloc_async is not supported on device 0')
size = 24
shape = (2, 3)
