File: atom_xchg.cl

package info (click to toggle)
libclc 0.2.0%2Bgit20190827-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,492 kB
  • sloc: lisp: 13,323; ansic: 2,435; python: 640; cpp: 93; sh: 29; makefile: 10; pascal: 7
file content (16 lines) | stat: -rw-r--r-- 303 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <clc/clc.h>

#ifdef cl_khr_int64_base_atomics

#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_xchg(volatile AS TYPE *p, TYPE val) { \
  return __sync_swap_8(p, val); \
}

IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL

#endif