Skip to content

Commit 96dc3fe

Browse files
committed
Using 1000 items and checking type
1 parent 8100ec0 commit 96dc3fe

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/atomics.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ all_types = vcat(integer_types, float_types)
88
dev = OpenCL.cl.device()
99
# Define atomic operations to test, with init value and expected value
1010
atomic_operations = [
11-
(:atomic_add!, 0, 1),
12-
(:atomic_sub!, 1, 0),
11+
(:atomic_add!, 0, 1000),
12+
(:atomic_sub!, 1000, 0),
1313
(:atomic_and!, 3, 1),
14-
(:atomic_or!, 2, 3),
15-
(:atomic_xor!, 3, 2),
14+
(:atomic_or!, 3, 3),
15+
(:atomic_xor!, 3, 3),
1616
(:atomic_max!, 0, 1),
1717
(:atomic_min!, 2, 1),
1818
(:atomic_xchg!, 0, 1),
@@ -112,9 +112,10 @@ for (op, init_val, expected_val) in atomic_operations
112112
a = OpenCL.zeros(T)
113113
OpenCL.fill!(a, init_val)
114114
kernel_func = @eval $test_name
115-
OpenCL.@opencl kernel_func(a)
115+
OpenCL.@opencl global_size=1000 kernel_func(a)
116116
result_val = Array(a)[1]
117-
@test result_val == expected_val
117+
@test typeof(result_val) == T
118+
@test result_val == T(expected_val)
118119
end
119120
end
120121

0 commit comments

Comments
 (0)