We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b30e666 commit 5e3b8caCopy full SHA for 5e3b8ca
tests/test_common.py
@@ -18,15 +18,13 @@ def test_common_atomicadd(test_context):
18
19
GPUKERN void test_atomic_add(GPUGLMEM double* out, int32_t iterations)
20
{
21
- double sum = 0;
22
VECTORIZE_OVER(i, iterations);
23
// If on CPU do some work to avoid the loop being optimized out
24
#if defined(XO_CONTEXT_CPU_OPENMP)
25
usleep(10);
26
#endif
27
- atomicAdd(&sum, 1.0);
+ atomicAdd(out, 1.0);
28
END_VECTORIZE;
29
- out[0] = sum;
30
}
31
"""
32
@@ -48,7 +46,7 @@ def test_common_atomicadd(test_context):
48
46
xo.Arg(xo.Float64, pointer=True, name="out"),
49
47
xo.Arg(xo.Int32, name="iterations"),
50
],
51
- n_threads="iterations",
+ n_threads=n_threads,
52
)
53
},
54
0 commit comments