diff --git a/test_conformance/generic_address_space/atomic_tests.cpp b/test_conformance/generic_address_space/atomic_tests.cpp index 8a568f0a..7ab65d36 100644 --- a/test_conformance/generic_address_space/atomic_tests.cpp +++ b/test_conformance/generic_address_space/atomic_tests.cpp @@ -35,7 +35,7 @@ kernel void testKernel(global atomic_int* globalPtr, local atomic_int* localPtr) int wgid = get_group_id(0); int wgsize = get_local_size(0); - if (tid == 0) atomic_store(localPtr, 0); + if (tid == 0) atomic_store_explicit(localPtr, 0, memory_order_relaxed, memory_scope_work_group); barrier(CLK_LOCAL_MEM_FENCE); @@ -47,12 +47,12 @@ kernel void testKernel(global atomic_int* globalPtr, local atomic_int* localPtr) if ((wgid % 2) == 0) ptr = localPtr; - int inc = atomic_fetch_add(ptr, 1); + int inc = atomic_fetch_add_explicit(ptr, 1, memory_order_relaxed, memory_scope_work_group); // In the cases where the local memory ptr was used, // save off the final value. if ((wgid % 2) == 0 && inc == (wgsize-1)) - atomic_store(&globalPtr[wgid], inc); + atomic_store_explicit(&globalPtr[wgid], inc, memory_order_relaxed, memory_scope_work_group); } )OpenCLC"; @@ -67,7 +67,7 @@ kernel void testKernel(global atomic_int* globalPtr, local atomic_int* localPtr) int wgid = get_group_id(0); int wgsize = get_local_size(0); - if (tid == 0) atomic_store(localPtr, 0); + if (tid == 0) atomic_store_explicit(localPtr, 0, memory_order_relaxed, memory_scope_work_group); barrier(CLK_LOCAL_MEM_FENCE); @@ -79,14 +79,17 @@ kernel void testKernel(global atomic_int* globalPtr, local atomic_int* localPtr) if ((tid % 2) == 0) ptr = localPtr; - atomic_fetch_add(ptr, 1); + atomic_fetch_add_explicit(ptr, 1, memory_order_relaxed, memory_scope_work_group); barrier(CLK_LOCAL_MEM_FENCE); // In the cases where the local memory ptr was used, // save off the final value. if (tid == 0) - atomic_store(&globalPtr[(wgid * 2) + 1], atomic_load(localPtr)); + atomic_store_explicit(&globalPtr[(wgid * 2) + 1], + atomic_load_explicit(localPtr, memory_order_relaxed, memory_scope_work_group), + memory_order_relaxed, + memory_scope_work_group); } )OpenCLC"; }