def check_ipc_array(self, index_arg=None, foreign=False):
    arr = np.arange(10, dtype=np.intp)
    devarr = cuda.to_device(arr)
    if (index_arg is not None):
        devarr = devarr[index_arg]
    if foreign:
        devarr = cuda.as_cuda_array(ForeignArray(devarr))
    expect = devarr.copy_to_host()
    ipch = devarr.get_ipc_handle()
    ctx = mp.get_context('spawn')
    result_queue = ctx.Queue()
    args = (ipch, result_queue)
    proc = ctx.Process(target=ipc_array_test, args=args)
    proc.start()
    (succ, out) = result_queue.get()
    if (not succ):
        self.fail(out)
    else:
        np.testing.assert_equal(expect, out)
    proc.join(3)
def check_ipc_array(self, index_arg=None, foreign=False):
    arr = np.arange(10, dtype=np.intp)
    devarr = cuda.to_device(arr)
    if (index_arg is not None):
        devarr = devarr[index_arg]
    if foreign:
        devarr = cuda.as_cuda_array(ForeignArray(devarr))
    expect = devarr.copy_to_host()
    ipch = devarr.get_ipc_handle()
    ctx = mp.get_context('spawn')
    result_queue = ctx.Queue()
    args = (ipch, result_queue)
    proc = ctx.Process(target=ipc_array_test, args=args)
    proc.start()
    (succ, out) = result_queue.get()
    if (not succ):
        self.fail(out)
    else:
        np.testing.assert_equal(expect, out)
    proc.join(3)