def cumsum(a, output_dtype=None, queue=None, wait_for=None, return_event=False
    ):
    """
    .. versionadded:: 2013.1
    """
    if output_dtype is None:
        output_dtype = a.dtype
    if wait_for is None:
        wait_for = []
    result = a._new_like_me(output_dtype)
    from pyopencl.scan import get_cumsum_kernel
    krnl = get_cumsum_kernel(a.context, a.dtype, output_dtype)
    evt = krnl(a, result, queue=queue, wait_for=wait_for + a.events)
    result.add_event(evt)
    if return_event:
        return evt, result
    else:
        return result
