There appears to be a serious bug in the AMD OpenCL compiler. It simply fails to compile any kernel involving atom_xchg, atom_cmpxchg, atomic_xchg, or atomic_cmpxchg. Other atomic functions work fine. Can anyone shed some light on this?
#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable __kernel void Test(volatile __global int *output) { atom_xchg(output, 0); }