|
| 1 | +//===----------------------------------------------------------------------===// |
| 2 | +// |
| 3 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +// See https://llvm.org/LICENSE.txt for license information. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +// |
| 7 | +//===----------------------------------------------------------------------===// |
| 8 | + |
| 9 | +#include <clc/clcfunc.h> |
| 10 | +#include <clc/clctypes.h> |
| 11 | + |
| 12 | +#ifdef cl_khr_global_int32_base_atomics |
| 13 | +_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile global int *p, int cmp, |
| 14 | + int val); |
| 15 | +_CLC_OVERLOAD _CLC_DECL unsigned int |
| 16 | +atom_cmpxchg(volatile global unsigned int *p, unsigned int cmp, |
| 17 | + unsigned int val); |
| 18 | +#endif // cl_khr_global_int32_base_atomics |
| 19 | + |
| 20 | +#ifdef cl_khr_local_int32_base_atomics |
| 21 | +_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile local int *p, int cmp, |
| 22 | + int val); |
| 23 | +_CLC_OVERLOAD _CLC_DECL unsigned int |
| 24 | +atom_cmpxchg(volatile local unsigned int *p, unsigned int cmp, |
| 25 | + unsigned int val); |
| 26 | +#endif // cl_khr_local_int32_base_atomics |
| 27 | + |
| 28 | +#ifdef cl_khr_int64_base_atomics |
| 29 | +_CLC_OVERLOAD _CLC_DECL long atom_cmpxchg(volatile global long *p, long cmp, |
| 30 | + long val); |
| 31 | +_CLC_OVERLOAD _CLC_DECL unsigned long |
| 32 | +atom_cmpxchg(volatile global unsigned long *p, unsigned long cmp, |
| 33 | + unsigned long val); |
| 34 | +_CLC_OVERLOAD _CLC_DECL long atom_cmpxchg(volatile local long *p, long cmp, |
| 35 | + long val); |
| 36 | +_CLC_OVERLOAD _CLC_DECL unsigned long |
| 37 | +atom_cmpxchg(volatile local unsigned long *p, unsigned long cmp, |
| 38 | + unsigned long val); |
| 39 | +#endif // cl_khr_int64_base_atomics |
0 commit comments