def METHOD_NAME( input_array, use_cuda ):
    """
    Return an array containing the cumulative sum of the 2darray `input_array`,
    where the cumsum is taken along the last axis.
    (The returned array has one more element than `input_array` along the
    last axis; its first element is 0 and its last element is the
    total sum of `input_array`)
    If needed, the calculation is performed on the GPU.
    """
    new_shape = (input_array.shape[0], input_array.shape[1]+1)
    if use_cuda:
        cumulative_array = cupy.zeros( new_shape, dtype=cupy.int64 )
        cupy.cumsum( input_array, out=cumulative_array[:,1:], axis=-1 )
    else:
        cumulative_array = np.zeros( new_shape, dtype=np.int64 )
        np.cumsum( input_array, out=cumulative_array[:,1:], axis=-1 )
    return( cumulative_array )