Skip to content

Commit e664758

Browse files
committed
fixing inc / dec issues
1 parent d117166 commit e664758

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/atomics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export @atomic, atomic_add!, atomic_sub!, atomic_and!, atomic_or!, atomic_xor!,
99
# helper functions for inc and dec
1010

1111
function dec(a::T,b::T) where T
12-
((a == 0) | (a > b)) ? b : (old-T(1))
12+
((a == 0) | (a > b)) ? b : (a-T(1))
1313
end
1414

1515
function inc(a::T,b::T) where T

test/atomic_test.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ function atomics_testsuite(backend)
7979
for T in types
8080
A = ArrayT{T}([1024,1024])
8181

82-
kernel = atomic_inc_kernel(backend(), 4)
82+
kernel = atomic_dec_kernel(backend(), 4)
8383
wait(kernel(A, T(512), ndrange=(256)))
8484

85-
@test Array(A)[2] == 255
85+
@test Array(A)[2] == 257
8686
end
8787
end
8888

0 commit comments

Comments
 (0)