123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- //---------------------------------------------------------------------------//
- // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
- //
- // Distributed under the Boost Software License, Version 1.0
- // See accompanying file LICENSE_1_0.txt or copy at
- // http://www.boost.org/LICENSE_1_0.txt
- //
- // See http://boostorg.github.com/compute for more information.
- //---------------------------------------------------------------------------//
- #ifndef BOOST_COMPUTE_FUNCTIONAL_ATOMIC_HPP
- #define BOOST_COMPUTE_FUNCTIONAL_ATOMIC_HPP
- #include <boost/compute/cl.hpp>
- #include <boost/compute/function.hpp>
- #ifndef BOOST_COMPUTE_DOXYGEN_INVOKED
- #ifdef BOOST_COMPUTE_CL_VERSION_1_1
- #define BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "atomic_"
- #else
- #define BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "atom_"
- #endif
- #endif // BOOST_COMPUTE_DOXYGEN_INVOKED
- namespace boost {
- namespace compute {
- template<class T>
- class atomic_add : public function<T (T*, T)>
- {
- public:
- atomic_add()
- : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "add")
- {
- }
- };
- template<class T>
- class atomic_sub : public function<T (T*, T)>
- {
- public:
- atomic_sub()
- : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "sub")
- {
- }
- };
- template<class T>
- class atomic_xchg : public function<T (T*, T)>
- {
- public:
- atomic_xchg()
- : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "xchg")
- {
- }
- };
- template<class T>
- class atomic_inc : public function<T (T*)>
- {
- public:
- atomic_inc()
- : function<T (T*)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "inc")
- {
- }
- };
- template<class T>
- class atomic_dec : public function<T (T*)>
- {
- public:
- atomic_dec()
- : function<T (T*)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "dec")
- {
- }
- };
- template<class T>
- class atomic_cmpxchg : public function<T (T*, T, T)>
- {
- public:
- atomic_cmpxchg()
- : function<T (T*, T, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "cmpxchg")
- {
- }
- };
- template<class T>
- class atomic_max : public function<T (T*, T)>
- {
- public:
- atomic_max()
- : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "max")
- {
- }
- };
- template<class T>
- class atomic_min : public function<T (T*, T)>
- {
- public:
- atomic_min()
- : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "min")
- {
- }
- };
- template<class T>
- class atomic_and : public function<T (T*, T)>
- {
- public:
- atomic_and()
- : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "and")
- {
- }
- };
- template<class T>
- class atomic_or : public function<T (T*, T)>
- {
- public:
- atomic_or()
- : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "or")
- {
- }
- };
- template<class T>
- class atomic_xor : public function<T (T*, T)>
- {
- public:
- atomic_xor()
- : function<T (T*, T)>(BOOST_COMPUTE_DETAIL_ATOMIC_PREFIX "xor")
- {
- }
- };
- } // end compute namespace
- } // end boost namespace
- #endif // BOOST_COMPUTE_FUNCTIONAL_ATOMIC_HPP
|