def test_ipc_handle(self):
    arr = np.arange(10, dtype=np.intp)
    devarr = cuda.to_device(arr)
    ctx = cuda.current_context()
    ipch = ctx.get_ipc_handle(devarr.gpu_data)
    handle_bytes = bytes(ipch.handle)
    size = ipch.size
    ctx = mp.get_context('spawn')
    result_queue = ctx.Queue()
    args = (handle_bytes, size, result_queue)
    proc = ctx.Process(target=base_ipc_handle_test, args=args)
    proc.start()
    (succ, out) = result_queue.get()
    if (not succ):
        self.fail(out)
    else:
        np.testing.assert_equal(arr, out)
    proc.join(3)
def test_ipc_handle(self):
    arr = np.arange(10, dtype=np.intp)
    devarr = cuda.to_device(arr)
    ctx = cuda.current_context()
    ipch = ctx.get_ipc_handle(devarr.gpu_data)
    handle_bytes = bytes(ipch.handle)
    size = ipch.size
    ctx = mp.get_context('spawn')
    result_queue = ctx.Queue()
    args = (handle_bytes, size, result_queue)
    proc = ctx.Process(target=base_ipc_handle_test, args=args)
    proc.start()
    (succ, out) = result_queue.get()
    if (not succ):
        self.fail(out)
    else:
        np.testing.assert_equal(arr, out)
    proc.join(3)