]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/compute/include/boost/compute/functional/atomic.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / compute / include / boost / compute / functional / atomic.hpp
CommitLineData
7c673cae
FG
1//---------------------------------------------------------------------------//
2// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
3//
4// Distributed under the Boost Software License, Version 1.0
5// See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt
7//
8// See http://boostorg.github.com/compute for more information.
9//---------------------------------------------------------------------------//
10
11#ifndef BOOST_COMPUTE_FUNCTIONAL_ATOMIC_HPP
12#define BOOST_COMPUTE_FUNCTIONAL_ATOMIC_HPP
13
14#include <boost/compute/cl.hpp>
15#include <boost/compute/function.hpp>
16
17#ifndef BOOST_COMPUTE_DOXYGEN_INVOKED
18#ifdef CL_VERSION_1_1
19 #define BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "atomic_"
20#else
21 #define BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "atom_"
22#endif
23#endif // BOOST_COMPUTE_DOXYGEN_INVOKED
24
25namespace boost {
26namespace compute {
27
28template<class T>
29class atomic_add : public function<T (T*, T)>
30{
31public:
32 atomic_add()
33 : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "add")
34 {
35 }
36};
37
38template<class T>
39class atomic_sub : public function<T (T*, T)>
40{
41public:
42 atomic_sub()
43 : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "sub")
44 {
45 }
46};
47
48template<class T>
49class atomic_xchg : public function<T (T*, T)>
50{
51public:
52 atomic_xchg()
53 : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "xchg")
54 {
55 }
56};
57
58template<class T>
59class atomic_inc : public function<T (T*)>
60{
61public:
62 atomic_inc()
63 : function<T (T*)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "inc")
64 {
65 }
66};
67
68template<class T>
69class atomic_dec : public function<T (T*)>
70{
71public:
72 atomic_dec()
73 : function<T (T*)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "dec")
74 {
75 }
76};
77
78template<class T>
79class atomic_cmpxchg : public function<T (T*, T, T)>
80{
81public:
82 atomic_cmpxchg()
83 : function<T (T*, T, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "cmpxchg")
84 {
85 }
86};
87
88template<class T>
89class atomic_max : public function<T (T*, T)>
90{
91public:
92 atomic_max()
93 : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "max")
94 {
95 }
96};
97
98template<class T>
99class atomic_min : public function<T (T*, T)>
100{
101public:
102 atomic_min()
103 : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "min")
104 {
105 }
106};
107
108template<class T>
109class atomic_and : public function<T (T*, T)>
110{
111public:
112 atomic_and()
113 : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "and")
114 {
115 }
116};
117
118template<class T>
119class atomic_or : public function<T (T*, T)>
120{
121public:
122 atomic_or()
123 : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "or")
124 {
125 }
126};
127
128template<class T>
129class atomic_xor : public function<T (T*, T)>
130{
131public:
132 atomic_xor()
133 : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "xor")
134 {
135 }
136};
137
138} // end compute namespace
139} // end boost namespace
140
141#endif // BOOST_COMPUTE_FUNCTIONAL_ATOMIC_HPP