diff --git a/test/test_array.py b/test/test_array.py index 381105bf8a3fc7cbeea70b658e863cb0efe6df99..b5e99273cf2d1313cd3c1506fa6d8a5912253a17 100644 --- a/test/test_array.py +++ b/test/test_array.py @@ -208,11 +208,13 @@ def test_vector_fill(ctx_factory): def test_zeros_large_array(ctx_factory): context = ctx_factory() queue = cl.CommandQueue(context) + dev = queue.device - if queue.device.address_bits == 64: + size = 2**28 + 1 + if dev.address_bits == 64 and dev.max_mem_alloc_size >= 8 * size: # this shouldn't hang/cause errors # see https://github.com/inducer/pyopencl/issues/395 - a_gpu = cl_array.zeros(queue, (2**28 + 1,), dtype="float64") + a_gpu = cl_array.zeros(queue, (size,), dtype="float64") # run a couple kernels to ensure no propagated runtime errors a_gpu[...] = 1. a_gpu = 2 * a_gpu - 3