1#include <clc/clc.h>
2
3#define IMPL(TYPE, AS) \
4_CLC_OVERLOAD _CLC_DEF TYPE atomic_add(volatile AS TYPE *p, TYPE val) { \
5 return __sync_fetch_and_add(p, val); \
6}
7
8IMPL(int, global)
9IMPL(unsigned int, global)
10IMPL(int, local)
11IMPL(unsigned int, local)
12#undef IMPL
13