Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/accumulate/accumulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ end


function accumulate!(
op, dst::AbstractArray, src::AbstractArray, backend::Backend=get_backend(v);
op, dst::AbstractArray, src::AbstractArray, backend::Backend=get_backend(dst);
init,
neutral=GPUArrays.neutral_element(op, eltype(dst)),
dims::Union{Nothing, Int}=nothing,
Expand Down
12 changes: 6 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1307,9 +1307,9 @@ end
for _ in 1:100
num_elems = rand(1:100_000)
x = array_from_host(rand(1:1000, num_elems), Int32)
y = copy(x)
y = similar(x)
init = rand(-1000:1000)
AK.accumulate!(+, y; init=Int32(init))
AK.accumulate!(+, y, x; init=Int32(init))
@test all(Array(y) .== accumulate(+, Array(x), init=init))
end

Expand Down Expand Up @@ -1395,7 +1395,7 @@ end
n3 = rand(1:100)
vh = rand(Float32, n1, n2, n3)
v = array_from_host(vh)

s = AK.accumulate(+, v; init=Float32(0), dims=dims)
sh = Array(s)
@test all(sh .≈ accumulate(+, vh, init=Float32(0), dims=dims))
Expand Down Expand Up @@ -1530,7 +1530,7 @@ end
AK.searchsortedfirst(v, x, by=abs, lt=(>), rev=true, block_size=64)
AK.searchsortedlast!(ix, v, x, by=abs, lt=(>), rev=true, block_size=64)
AK.searchsortedlast(v, x, by=abs, lt=(>), rev=true, block_size=64)

vh = Array(v)
xh = Array(x)
ixh = similar(xh, Int32)
Expand Down Expand Up @@ -1809,7 +1809,7 @@ end


@testset "cumsum" begin

Random.seed!(0)

# Simple correctness tests
Expand Down Expand Up @@ -1858,7 +1858,7 @@ end


@testset "cumprod" begin

Random.seed!(0)

# Simple correctness tests
Expand Down
Loading