@@ -1307,9 +1307,9 @@ end
13071307 for _ in 1 : 100
13081308 num_elems = rand (1 : 100_000 )
13091309 x = array_from_host (rand (1 : 1000 , num_elems), Int32)
1310- y = copy (x)
1310+ y = similar (x)
13111311 init = rand (- 1000 : 1000 )
1312- AK. accumulate! (+ , y; init= Int32 (init))
1312+ AK. accumulate! (+ , y, x ; init= Int32 (init))
13131313 @test all (Array (y) .== accumulate (+ , Array (x), init= init))
13141314 end
13151315
@@ -1395,7 +1395,7 @@ end
13951395 n3 = rand (1 : 100 )
13961396 vh = rand (Float32, n1, n2, n3)
13971397 v = array_from_host (vh)
1398-
1398+
13991399 s = AK. accumulate (+ , v; init= Float32 (0 ), dims= dims)
14001400 sh = Array (s)
14011401 @test all (sh .≈ accumulate (+ , vh, init= Float32 (0 ), dims= dims))
@@ -1530,7 +1530,7 @@ end
15301530 AK. searchsortedfirst (v, x, by= abs, lt= (> ), rev= true , block_size= 64 )
15311531 AK. searchsortedlast! (ix, v, x, by= abs, lt= (> ), rev= true , block_size= 64 )
15321532 AK. searchsortedlast (v, x, by= abs, lt= (> ), rev= true , block_size= 64 )
1533-
1533+
15341534 vh = Array (v)
15351535 xh = Array (x)
15361536 ixh = similar (xh, Int32)
@@ -1809,7 +1809,7 @@ end
18091809
18101810
18111811@testset " cumsum" begin
1812-
1812+
18131813 Random. seed! (0 )
18141814
18151815 # Simple correctness tests
@@ -1858,7 +1858,7 @@ end
18581858
18591859
18601860@testset " cumprod" begin
1861-
1861+
18621862 Random. seed! (0 )
18631863
18641864 # Simple correctness tests
0 commit comments