|
| 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 | +#ifndef __CLC_OPENCL_ATOMIC_ATOMIC_FLAG_TEST_AND_SET_H__ |
| 10 | +#define __CLC_OPENCL_ATOMIC_ATOMIC_FLAG_TEST_AND_SET_H__ |
| 11 | + |
| 12 | +#include <clc/opencl/opencl-base.h> |
| 13 | +#include <clc/opencl/types.h> |
| 14 | + |
| 15 | +#if defined(__opencl_c_atomic_order_seq_cst) && \ |
| 16 | + defined(__opencl_c_atomic_scope_device) |
| 17 | +_CLC_OVERLOAD _CLC_DECL bool |
| 18 | +atomic_flag_test_and_set(volatile __global atomic_flag *); |
| 19 | +_CLC_OVERLOAD _CLC_DECL bool |
| 20 | +atomic_flag_test_and_set(volatile __local atomic_flag *); |
| 21 | +#if defined(__opencl_c_generic_address_space) |
| 22 | +_CLC_OVERLOAD _CLC_DECL bool atomic_flag_test_and_set(volatile atomic_flag *); |
| 23 | +#endif // defined(__opencl_c_generic_address_space) |
| 24 | +#endif |
| 25 | + |
| 26 | +#if defined(__opencl_c_atomic_scope_device) |
| 27 | +_CLC_OVERLOAD _CLC_DECL bool |
| 28 | +atomic_flag_test_and_set_explicit(volatile __global atomic_flag *, |
| 29 | + memory_order); |
| 30 | +_CLC_OVERLOAD _CLC_DECL bool |
| 31 | +atomic_flag_test_and_set_explicit(volatile __local atomic_flag *, memory_order); |
| 32 | +#if defined(__opencl_c_generic_address_space) |
| 33 | +_CLC_OVERLOAD _CLC_DECL bool |
| 34 | +atomic_flag_test_and_set_explicit(volatile atomic_flag *, memory_order); |
| 35 | +#endif // defined(__opencl_c_generic_address_space) |
| 36 | +#endif |
| 37 | + |
| 38 | +_CLC_OVERLOAD _CLC_DECL bool |
| 39 | +atomic_flag_test_and_set_explicit(volatile __global atomic_flag *, memory_order, |
| 40 | + memory_scope); |
| 41 | +_CLC_OVERLOAD _CLC_DECL bool |
| 42 | +atomic_flag_test_and_set_explicit(volatile __local atomic_flag *, memory_order, |
| 43 | + memory_scope); |
| 44 | +#if defined(__opencl_c_generic_address_space) |
| 45 | +_CLC_OVERLOAD _CLC_DECL bool |
| 46 | +atomic_flag_test_and_set_explicit(volatile atomic_flag *, memory_order, |
| 47 | + memory_scope); |
| 48 | +#endif // defined(__opencl_c_generic_address_space) |
| 49 | + |
| 50 | +#endif // __CLC_OPENCL_ATOMIC_ATOMIC_FLAG_TEST_AND_SET_H__ |
0 commit comments