final gpu-enabling tweaks

This commit is contained in:
Eric Niebler
2014-01-28 14:32:03 -08:00
parent c04e912866
commit e113b31fdd
13 changed files with 18 additions and 35 deletions

View File

@ -445,12 +445,14 @@
(NAME, ATTRIBUTES_SEQ) \ (NAME, ATTRIBUTES_SEQ) \
\ \
template <typename boost_fusion_detail_Seq> \ template <typename boost_fusion_detail_Seq> \
BOOST_FUSION_GPU_ENABLED \
NAME(const boost_fusion_detail_Seq& rhs) \ NAME(const boost_fusion_detail_Seq& rhs) \
{ \ { \
boost::fusion::copy(rhs, *this); \ boost::fusion::copy(rhs, *this); \
} \ } \
\ \
template <typename boost_fusion_detail_Seq> \ template <typename boost_fusion_detail_Seq> \
BOOST_FUSION_GPU_ENABLED \
NAME& operator=(const boost_fusion_detail_Seq& rhs) \ NAME& operator=(const boost_fusion_detail_Seq& rhs) \
{ \ { \
boost::fusion::copy(rhs, *this); \ boost::fusion::copy(rhs, *this); \

View File

@ -17,6 +17,7 @@ namespace boost { namespace fusion { namespace detail
{ {
typedef typename result_of::value_of<It>::type type; typedef typename result_of::value_of<It>::type type;
BOOST_FUSION_GPU_ENABLED
static inline type call(It const& it) static inline type call(It const& it)
{ {
return *it; return *it;
@ -30,6 +31,7 @@ namespace boost { namespace fusion { namespace detail
typedef typename result_of::value_of_data<It>::type data_type; typedef typename result_of::value_of_data<It>::type data_type;
typedef typename fusion::pair<key_type, data_type> type; typedef typename fusion::pair<key_type, data_type> type;
BOOST_FUSION_GPU_ENABLED
static inline type call(It const& it) static inline type call(It const& it)
{ {
return type(deref_data(it)); return type(deref_data(it));

View File

@ -37,6 +37,7 @@ namespace boost { namespace fusion
public: public:
BOOST_FUSION_GPU_ENABLED
inline explicit fused(func_const_fwd_t f = Function()) inline explicit fused(func_const_fwd_t f = Function())
: fnc_transformed(f) : fnc_transformed(f)
{ } { }

View File

@ -37,6 +37,7 @@ namespace boost { namespace fusion
public: public:
BOOST_FUSION_GPU_ENABLED
inline explicit fused_function_object(func_const_fwd_t f = Function()) inline explicit fused_function_object(func_const_fwd_t f = Function())
: fnc_transformed(f) : fnc_transformed(f)
{ } { }

View File

@ -37,6 +37,7 @@ namespace boost { namespace fusion
public: public:
BOOST_FUSION_GPU_ENABLED
inline explicit fused_procedure(func_const_fwd_t f = Function()) inline explicit fused_procedure(func_const_fwd_t f = Function())
: fnc_transformed(f) : fnc_transformed(f)
{ } { }

View File

@ -79,6 +79,7 @@ namespace boost { namespace fusion
typedef typename detail::call_param<Function>::type func_const_fwd_t; typedef typename detail::call_param<Function>::type func_const_fwd_t;
public: public:
BOOST_FUSION_GPU_ENABLED
inline explicit unfused(func_const_fwd_t f = function()) inline explicit unfused(func_const_fwd_t f = function())
: fnc_transformed(f) : fnc_transformed(f)
{ } { }

View File

@ -63,6 +63,7 @@ namespace boost { namespace fusion
public: public:
BOOST_FUSION_GPU_ENABLED
inline explicit unfused_typed(func_const_fwd_t f = Function()) inline explicit unfused_typed(func_const_fwd_t f = Function())
: fnc_transformed(f) : fnc_transformed(f)
{ } { }
@ -129,7 +130,8 @@ namespace boost
#define M(z,i,s) \ #define M(z,i,s) \
typename call_param<typename result_of::value_at_c<s,i>::type>::type a##i typename call_param<typename result_of::value_at_c<s,i>::type>::type a##i
inline typename boost::result_of< BOOST_FUSION_GPU_ENABLED
inline typename boost::result_of<
function_c(arg_vector_t &) >::type function_c(arg_vector_t &) >::type
operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) const operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) const
{ {
@ -141,7 +143,8 @@ namespace boost
return static_cast<Derived const *>(this)->fnc_transformed(arg); return static_cast<Derived const *>(this)->fnc_transformed(arg);
} }
BOOST_FUSION_GPU_ENABLED inline typename boost::result_of< BOOST_FUSION_GPU_ENABLED
inline typename boost::result_of<
function(arg_vector_t &) >::type function(arg_vector_t &) >::type
operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) operator()(BOOST_PP_ENUM(N,M,arg_vector_t))
{ {

View File

@ -24,6 +24,7 @@ namespace boost { namespace fusion
iterator_base_type; iterator_base_type;
iterator_base_type iterator_base; iterator_base_type iterator_base;
BOOST_FUSION_GPU_ENABLED
iterator_adapter(iterator_base_type const& iterator_base_) iterator_adapter(iterator_base_type const& iterator_base_)
: iterator_base(iterator_base_) {} : iterator_base(iterator_base_) {}

View File

@ -27,7 +27,6 @@ namespace boost { namespace fusion { namespace detail
{ {
// read a delimiter // read a delimiter
template <typename IS> template <typename IS>
BOOST_FUSION_GPU_ENABLED
static void static void
read(IS& is, char const* delim, mpl::false_ = mpl::false_()) read(IS& is, char const* delim, mpl::false_ = mpl::false_())
{ {
@ -36,7 +35,6 @@ namespace boost { namespace fusion { namespace detail
} }
template <typename IS> template <typename IS>
BOOST_FUSION_GPU_ENABLED
static void static void
read(IS&, char const*, mpl::true_) read(IS&, char const*, mpl::true_)
{ {
@ -46,14 +44,12 @@ namespace boost { namespace fusion { namespace detail
struct read_sequence_loop struct read_sequence_loop
{ {
template <typename IS, typename First, typename Last> template <typename IS, typename First, typename Last>
BOOST_FUSION_GPU_ENABLED
static void static void
call(IS&, First const&, Last const&, mpl::true_) call(IS&, First const&, Last const&, mpl::true_)
{ {
} }
template <typename IS, typename First, typename Last> template <typename IS, typename First, typename Last>
BOOST_FUSION_GPU_ENABLED
static void static void
call(IS& is, First const& first, Last const& last, mpl::false_) call(IS& is, First const& first, Last const& last, mpl::false_)
{ {
@ -69,7 +65,6 @@ namespace boost { namespace fusion { namespace detail
} }
template <typename IS, typename First, typename Last> template <typename IS, typename First, typename Last>
BOOST_FUSION_GPU_ENABLED
static void static void
call(IS& is, First const& first, Last const& last) call(IS& is, First const& first, Last const& last)
{ {
@ -79,7 +74,6 @@ namespace boost { namespace fusion { namespace detail
}; };
template <typename IS, typename Sequence> template <typename IS, typename Sequence>
BOOST_FUSION_GPU_ENABLED
inline void inline void
read_sequence(IS& is, Sequence& seq) read_sequence(IS& is, Sequence& seq)
{ {

View File

@ -36,7 +36,6 @@ namespace boost { namespace fusion
namespace detail namespace detail
{ {
template <typename Tag> template <typename Tag>
BOOST_FUSION_GPU_ENABLED
int get_xalloc_index(Tag* = 0) int get_xalloc_index(Tag* = 0)
{ {
// each Tag will have a unique index // each Tag will have a unique index
@ -49,7 +48,6 @@ namespace boost { namespace fusion
{ {
struct arena struct arena
{ {
BOOST_FUSION_GPU_ENABLED
~arena() ~arena()
{ {
for ( for (
@ -64,7 +62,6 @@ namespace boost { namespace fusion
std::vector<T*> data; std::vector<T*> data;
}; };
BOOST_FUSION_GPU_ENABLED
static void attach(Stream& stream, T const& data) static void attach(Stream& stream, T const& data)
{ {
static arena ar; // our arena static arena ar; // our arena
@ -72,7 +69,6 @@ namespace boost { namespace fusion
stream.pword(get_xalloc_index<Tag>()) = ar.data.back(); stream.pword(get_xalloc_index<Tag>()) = ar.data.back();
} }
BOOST_FUSION_GPU_ENABLED
static T const* get(Stream& stream) static T const* get(Stream& stream)
{ {
return (T const*)stream.pword(get_xalloc_index<Tag>()); return (T const*)stream.pword(get_xalloc_index<Tag>());
@ -88,19 +84,16 @@ namespace boost { namespace fusion
typedef stream_data<Stream, Tag, string_type> stream_data_t; typedef stream_data<Stream, Tag, string_type> stream_data_t;
BOOST_FUSION_GPU_ENABLED
string_ios_manip(Stream& str_) string_ios_manip(Stream& str_)
: stream(str_) : stream(str_)
{} {}
BOOST_FUSION_GPU_ENABLED
void void
set(string_type const& s) set(string_type const& s)
{ {
stream_data_t::attach(stream, s); stream_data_t::attach(stream, s);
} }
BOOST_FUSION_GPU_ENABLED
void void
print(char const* default_) const print(char const* default_) const
{ {
@ -112,7 +105,6 @@ namespace boost { namespace fusion
stream << default_; stream << default_;
} }
BOOST_FUSION_GPU_ENABLED
void void
read(char const* default_) const read(char const* default_) const
{ {
@ -137,7 +129,6 @@ namespace boost { namespace fusion
private: private:
template <typename Char> template <typename Char>
BOOST_FUSION_GPU_ENABLED
void void
check_delim(Char c) const check_delim(Char c) const
{ {
@ -165,35 +156,30 @@ namespace boost { namespace fusion
#define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ #define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \
template <typename Char, typename Traits> \ template <typename Char, typename Traits> \
BOOST_FUSION_GPU_ENABLED \
inline detail::name##_type<Char, Traits> \ inline detail::name##_type<Char, Traits> \
name(const std::basic_string<Char, Traits>& s) \ name(const std::basic_string<Char, Traits>& s) \
{ \ { \
return detail::name##_type<Char, Traits>(s); \ return detail::name##_type<Char, Traits>(s); \
} \ } \
\ \
BOOST_FUSION_GPU_ENABLED \
inline detail::name##_type<char> \ inline detail::name##_type<char> \
name(char const* s) \ name(char const* s) \
{ \ { \
return detail::name##_type<char>(std::basic_string<char>(s)); \ return detail::name##_type<char>(std::basic_string<char>(s)); \
} \ } \
\ \
BOOST_FUSION_GPU_ENABLED \
inline detail::name##_type<wchar_t> \ inline detail::name##_type<wchar_t> \
name(wchar_t const* s) \ name(wchar_t const* s) \
{ \ { \
return detail::name##_type<wchar_t>(std::basic_string<wchar_t>(s)); \ return detail::name##_type<wchar_t>(std::basic_string<wchar_t>(s)); \
} \ } \
\ \
BOOST_FUSION_GPU_ENABLED \
inline detail::name##_type<char> \ inline detail::name##_type<char> \
name(char c) \ name(char c) \
{ \ { \
return detail::name##_type<char>(std::basic_string<char>(1, c)); \ return detail::name##_type<char>(std::basic_string<char>(1, c)); \
} \ } \
\ \
BOOST_FUSION_GPU_ENABLED \
inline detail::name##_type<wchar_t> \ inline detail::name##_type<wchar_t> \
name(wchar_t c) \ name(wchar_t c) \
{ \ { \
@ -204,7 +190,6 @@ namespace boost { namespace fusion
#define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ #define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \
template <typename Char, typename Traits> \ template <typename Char, typename Traits> \
BOOST_FUSION_GPU_ENABLED \
inline detail::name##_type<Char, Traits> \ inline detail::name##_type<Char, Traits> \
name(const std::basic_string<Char, Traits>& s) \ name(const std::basic_string<Char, Traits>& s) \
{ \ { \
@ -212,7 +197,6 @@ namespace boost { namespace fusion
} \ } \
\ \
template <typename Char> \ template <typename Char> \
BOOST_FUSION_GPU_ENABLED \
inline detail::name##_type<Char> \ inline detail::name##_type<Char> \
name(Char s[]) \ name(Char s[]) \
{ \ { \
@ -220,7 +204,6 @@ namespace boost { namespace fusion
} \ } \
\ \
template <typename Char> \ template <typename Char> \
BOOST_FUSION_GPU_ENABLED \
inline detail::name##_type<Char> \ inline detail::name##_type<Char> \
name(Char const s[]) \ name(Char const s[]) \
{ \ { \
@ -228,7 +211,6 @@ namespace boost { namespace fusion
} \ } \
\ \
template <typename Char> \ template <typename Char> \
BOOST_FUSION_GPU_ENABLED \
inline detail::name##_type<Char> \ inline detail::name##_type<Char> \
name(Char c) \ name(Char c) \
{ \ { \
@ -247,12 +229,10 @@ namespace boost { namespace fusion
{ \ { \
typedef std::basic_string<Char, Traits> string_type; \ typedef std::basic_string<Char, Traits> string_type; \
string_type data; \ string_type data; \
BOOST_FUSION_GPU_ENABLED \
name##_type(const string_type& d): data(d) {} \ name##_type(const string_type& d): data(d) {} \
}; \ }; \
\ \
template <typename Stream, typename Char, typename Traits> \ template <typename Stream, typename Char, typename Traits> \
BOOST_FUSION_GPU_ENABLED \
Stream& operator>>(Stream& s, const name##_type<Char,Traits>& m) \ Stream& operator>>(Stream& s, const name##_type<Char,Traits>& m) \
{ \ { \
string_ios_manip<name##_tag, Stream>(s).set(m.data); \ string_ios_manip<name##_tag, Stream>(s).set(m.data); \
@ -260,7 +240,6 @@ namespace boost { namespace fusion
} \ } \
\ \
template <typename Stream, typename Char, typename Traits> \ template <typename Stream, typename Char, typename Traits> \
BOOST_FUSION_GPU_ENABLED \
Stream& operator<<(Stream& s, const name##_type<Char,Traits>& m) \ Stream& operator<<(Stream& s, const name##_type<Char,Traits>& m) \
{ \ { \
string_ios_manip<name##_tag, Stream>(s).set(m.data); \ string_ios_manip<name##_tag, Stream>(s).set(m.data); \

View File

@ -27,7 +27,6 @@ namespace boost { namespace fusion { namespace detail
{ {
// print a delimiter // print a delimiter
template <typename OS> template <typename OS>
BOOST_FUSION_GPU_ENABLED
static void static void
print(OS& os, char const* delim, mpl::false_ = mpl::false_()) print(OS& os, char const* delim, mpl::false_ = mpl::false_())
{ {
@ -36,7 +35,6 @@ namespace boost { namespace fusion { namespace detail
} }
template <typename OS> template <typename OS>
BOOST_FUSION_GPU_ENABLED
static void static void
print(OS&, char const*, mpl::true_) print(OS&, char const*, mpl::true_)
{ {
@ -46,14 +44,12 @@ namespace boost { namespace fusion { namespace detail
struct print_sequence_loop struct print_sequence_loop
{ {
template <typename OS, typename First, typename Last> template <typename OS, typename First, typename Last>
BOOST_FUSION_GPU_ENABLED
static void static void
call(OS&, First const&, Last const&, mpl::true_) call(OS&, First const&, Last const&, mpl::true_)
{ {
} }
template <typename OS, typename First, typename Last> template <typename OS, typename First, typename Last>
BOOST_FUSION_GPU_ENABLED
static void static void
call(OS& os, First const& first, Last const& last, mpl::false_) call(OS& os, First const& first, Last const& last, mpl::false_)
{ {
@ -69,7 +65,6 @@ namespace boost { namespace fusion { namespace detail
} }
template <typename OS, typename First, typename Last> template <typename OS, typename First, typename Last>
BOOST_FUSION_GPU_ENABLED
static void static void
call(OS& os, First const& first, Last const& last) call(OS& os, First const& first, Last const& last)
{ {
@ -79,7 +74,6 @@ namespace boost { namespace fusion { namespace detail
}; };
template <typename OS, typename Sequence> template <typename OS, typename Sequence>
BOOST_FUSION_GPU_ENABLED
inline void inline void
print_sequence(OS& os, Sequence const& seq) print_sequence(OS& os, Sequence const& seq)
{ {

View File

@ -77,6 +77,7 @@ namespace boost { namespace fusion
} }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_FUSION_GPU_ENABLED
pair& operator=(pair&& rhs) pair& operator=(pair&& rhs)
{ {
second = std::forward<Second>(rhs.second); second = std::forward<Second>(rhs.second);

View File

@ -22,18 +22,21 @@ namespace boost { namespace fusion
template <typename Sequence> template <typename Sequence>
struct sequence_base struct sequence_base
{ {
BOOST_FUSION_GPU_ENABLED
Sequence const& Sequence const&
derived() const derived() const
{ {
return static_cast<Sequence const&>(*this); return static_cast<Sequence const&>(*this);
} }
BOOST_FUSION_GPU_ENABLED
Sequence& Sequence&
derived() derived()
{ {
return static_cast<Sequence&>(*this); return static_cast<Sequence&>(*this);
} }
BOOST_FUSION_GPU_ENABLED
operator detail::from_sequence_convertible_type()const operator detail::from_sequence_convertible_type()const
{ {
return detail::from_sequence_convertible_type(); return detail::from_sequence_convertible_type();