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