def test_ipc_array(self):
    for device_num in range(len(cuda.gpus)):
        arr = np.random.random(10)
        devarr = cuda.to_device(arr)
        ipch = devarr.get_ipc_handle()
        ctx = mp.get_context('spawn')
        result_queue = ctx.Queue()
        args = (ipch, device_num, result_queue)
        proc = ctx.Process(target=staged_ipc_array_test, args=args)
        proc.start()
        (succ, out) = result_queue.get()
        proc.join(3)
        if (not succ):
            self.fail(out)
        else:
            np.testing.assert_equal(arr, out)
def test_ipc_array(self):
    for device_num in range(len(cuda.gpus)):
        arr = np.random.random(10)
        devarr = cuda.to_device(arr)
        ipch = devarr.get_ipc_handle()
        ctx = mp.get_context('spawn')
        result_queue = ctx.Queue()
        args = (ipch, device_num, result_queue)
        proc = ctx.Process(target=staged_ipc_array_test, args=args)
        proc.start()
        (succ, out) = result_queue.get()
        proc.join(3)
        if (not succ):
            self.fail(out)
        else:
            np.testing.assert_equal(arr, out)