gpu-enable functions

This commit is contained in:
Eric Niebler
2014-01-09 17:58:06 -08:00
committed by Eric Niebler
parent 867c7e5dfb
commit c4f9f0d1b6
840 changed files with 7409 additions and 116 deletions

View File

@ -16,6 +16,7 @@ namespace boost { namespace fusion { namespace extension
// such contexts with calls to this function. Users can
// specialize this function for their own wrappers.
template <typename T>
BOOST_FUSION_GPU_ENABLED
const T& as_const(const T& obj)
{
return obj;

View File

@ -7,6 +7,7 @@
#if !defined(FUSION_CATEGORY_OF_07202005_0308)
#define FUSION_CATEGORY_OF_07202005_0308
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/category_of.hpp>
#include <boost/fusion/support/tag_of.hpp>
#include <boost/type_traits/is_base_of.hpp>

View File

@ -0,0 +1,16 @@
/*=============================================================================
Copyright (c) 2014 Eric Niebler
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)
==============================================================================*/
#if !defined(FUSION_SUPPORT_CONFIG_01092014_1718)
#define FUSION_SUPPORT_CONFIG_01092014_1718
#include <boost/config.hpp>
#ifndef BOOST_FUSION_GPU_ENABLED
#define BOOST_FUSION_GPU_ENABLED BOOST_GPU_ENABLED
#endif
#endif

View File

@ -9,6 +9,7 @@
#if !defined(BOOST_FUSION_SUPPORT_DEDUCE_HPP_INCLUDED)
#define BOOST_FUSION_SUPPORT_DEDUCE_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/ref.hpp>
namespace boost { namespace fusion { namespace traits

View File

@ -9,6 +9,7 @@
#if !defined(BOOST_FUSION_SUPPORT_DEDUCE_SEQUENCE_HPP_INCLUDED)
#define BOOST_FUSION_SUPPORT_DEDUCE_SEQUENCE_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/deduce.hpp>
#include <boost/fusion/container/vector/convert.hpp>
#include <boost/fusion/view/transform_view.hpp>
@ -34,6 +35,7 @@ namespace boost { namespace fusion { namespace traits
// never called, but needed for decltype-based result_of (C++0x)
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <typename T>
BOOST_FUSION_GPU_ENABLED
typename result< deducer(T) >::type
operator()(T&&) const;
#endif

View File

@ -7,6 +7,7 @@
#if !defined(FUSION_ACCESS_04182005_0737)
#define FUSION_ACCESS_04182005_0737
#include <boost/fusion/support/config.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>

View File

@ -8,6 +8,7 @@
#if !defined(FUSION_AS_FUSION_ELEMENT_05052005_0338)
#define FUSION_AS_FUSION_ELEMENT_05052005_0338
#include <boost/fusion/support/config.hpp>
#include <boost/ref.hpp>
namespace boost { namespace fusion { namespace detail

View File

@ -8,6 +8,7 @@
#if !defined(FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105)
#define FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/and.hpp>

View File

@ -8,6 +8,7 @@
#ifndef BOOST_BOOST_FUSION_SUPPORT_PP_ROUND_HPP
#define BOOST_BOOST_FUSION_SUPPORT_PP_ROUND_HPP
#include <boost/fusion/support/config.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/comparison/less.hpp>
#include <boost/preprocessor/control/if.hpp>

View File

@ -7,6 +7,7 @@
#if !defined(BOOST_FUSION_SEGMENTED_FOLD_UNTIL_IMPL_HPP_INCLUDED)
#define BOOST_FUSION_SEGMENTED_FOLD_UNTIL_IMPL_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
@ -65,6 +66,7 @@ namespace boost { namespace fusion
}
template <typename Cur, typename Context>
BOOST_FUSION_GPU_ENABLED
typename result_of::make_segmented_iterator<Cur, Context>::type
make_segmented_iterator(Cur const& cur, Context const& context)
{
@ -119,6 +121,7 @@ namespace boost { namespace fusion
typedef iterator_range<Cur, End> range_type;
typedef cons<range_type, Context> type;
BOOST_FUSION_GPU_ENABLED
static type call(Cur const& cur, End const& end, Context const& context)
{
return cons<range_type, Context>(range_type(cur, end), context);
@ -167,6 +170,7 @@ namespace boost { namespace fusion
typedef typename impl::type type;
typedef typename impl::continue_type continue_type;
BOOST_FUSION_GPU_ENABLED
static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun)
{
return impl::call(fusion::segments(seq), state, context, fun);
@ -188,6 +192,7 @@ namespace boost { namespace fusion
typedef typename apply_type::type type;
typedef typename apply_type::continue_type continue_type;
BOOST_FUSION_GPU_ENABLED
static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun)
{
return apply_type::call(seq, state, context, fun);
@ -269,12 +274,14 @@ namespace boost { namespace fusion
>::type
continue_type;
BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun)
{
return call(beg, end, state, context, fun, typename fold_recurse_impl::continue_type());
}
BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun, mpl::true_) // continue
{
@ -290,6 +297,7 @@ namespace boost { namespace fusion
, fun);
}
BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun, mpl::false_) // break
{
@ -317,6 +325,7 @@ namespace boost { namespace fusion
typedef typename impl::type type;
typedef typename impl::continue_type continue_type;
BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun)
{
@ -342,6 +351,7 @@ namespace boost { namespace fusion
typedef typename impl::type type;
typedef typename impl::continue_type continue_type;
BOOST_FUSION_GPU_ENABLED
static type call(Begin const& beg, End const& end, State const& state
, Context const& context, Fun const& fun)
{
@ -355,6 +365,7 @@ namespace boost { namespace fusion
typedef State type;
typedef mpl::true_ continue_type;
BOOST_FUSION_GPU_ENABLED
static type call(Begin const&, End const&, State const& state
, Context const&, Fun const&)
{
@ -378,6 +389,7 @@ namespace boost { namespace fusion
typedef typename impl::type type;
typedef typename impl::continue_type continue_type;
BOOST_FUSION_GPU_ENABLED
static type call(Segments& segs, State const& state, Context const& context, Fun const& fun)
{
return impl::call(fusion::begin(segs), fusion::end(segs), state, context, fun);

View File

@ -7,6 +7,7 @@
#if !defined(FUSION_IS_ITERATOR_05062005_1219)
#define FUSION_IS_ITERATOR_05062005_1219
#include <boost/fusion/support/config.hpp>
#include <boost/type_traits/is_base_of.hpp>
namespace boost { namespace fusion

View File

@ -7,6 +7,7 @@
#if !defined(FUSION_IS_SEGMENTED_03202006_0015)
#define FUSION_IS_SEGMENTED_03202006_0015
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/fusion/support/tag_of.hpp>

View File

@ -7,6 +7,7 @@
#if !defined(FUSION_IS_SEQUENCE_05052005_1002)
#define FUSION_IS_SEQUENCE_05052005_1002
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/tag_of.hpp>
#include <boost/mpl/is_sequence.hpp>

View File

@ -7,6 +7,7 @@
#if !defined(FUSION_IS_VIEW_03202006_0015)
#define FUSION_IS_VIEW_03202006_0015
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/fusion/support/detail/is_view.hpp>
#include <boost/fusion/support/tag_of.hpp>

View File

@ -7,6 +7,8 @@
#if !defined(FUSION_ITERATOR_BASE_05042005_1008)
#define FUSION_ITERATOR_BASE_05042005_1008
#include <boost/fusion/support/config.hpp>
namespace boost { namespace fusion
{
struct iterator_root {};
@ -14,12 +16,14 @@ namespace boost { namespace fusion
template <typename Iterator>
struct iterator_base : iterator_root
{
BOOST_FUSION_GPU_ENABLED
Iterator const&
cast() const
{
return static_cast<Iterator const&>(*this);
}
BOOST_FUSION_GPU_ENABLED
Iterator&
cast()
{

View File

@ -8,6 +8,7 @@
#if !defined(FUSION_PAIR_07222005_1203)
#define FUSION_PAIR_07222005_1203
#include <boost/fusion/support/config.hpp>
#include <iosfwd>
#include <boost/fusion/support/detail/access.hpp>
@ -27,23 +28,28 @@ namespace boost { namespace fusion
template <typename First, typename Second>
struct pair
{
BOOST_FUSION_GPU_ENABLED
pair()
: second() {}
BOOST_FUSION_GPU_ENABLED
pair(pair const& rhs)
: second(rhs.second) {}
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_FUSION_GPU_ENABLED
pair(pair&& rhs)
: second(std::forward<Second>(rhs.second)) {}
#endif
BOOST_FUSION_GPU_ENABLED
pair(typename detail::call_param<Second>::type val)
: second(val) {}
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename Second2>
BOOST_FUSION_GPU_ENABLED
pair(Second2&& val
, typename boost::enable_if<is_convertible<Second2, Second> >::type* /*dummy*/ = 0
) : second(std::forward<Second2>(val)) {}
@ -51,16 +57,19 @@ namespace boost { namespace fusion
#endif
template <typename Second2>
BOOST_FUSION_GPU_ENABLED
pair(pair<First, Second2> const& rhs)
: second(rhs.second) {}
template <typename Second2>
BOOST_FUSION_GPU_ENABLED
pair& operator=(pair<First, Second2> const& rhs)
{
second = rhs.second;
return *this;
}
BOOST_FUSION_GPU_ENABLED
pair& operator=(pair const& rhs)
{
second = rhs.second;
@ -103,6 +112,7 @@ namespace boost { namespace fusion
}
template <typename First, typename Second>
BOOST_FUSION_GPU_ENABLED
inline typename result_of::make_pair<First,Second>::type
make_pair(Second const& val)
{
@ -110,6 +120,7 @@ namespace boost { namespace fusion
}
template <typename First, typename Second>
BOOST_FUSION_GPU_ENABLED
inline std::ostream&
operator<<(std::ostream& os, pair<First, Second> const& p)
{
@ -118,6 +129,7 @@ namespace boost { namespace fusion
}
template <typename First, typename Second>
BOOST_FUSION_GPU_ENABLED
inline std::istream&
operator>>(std::istream& is, pair<First, Second>& p)
{
@ -126,6 +138,7 @@ namespace boost { namespace fusion
}
template <typename First, typename SecondL, typename SecondR>
BOOST_FUSION_GPU_ENABLED
inline bool
operator==(pair<First, SecondL> const& l, pair<First, SecondR> const& r)
{
@ -133,6 +146,7 @@ namespace boost { namespace fusion
}
template <typename First, typename SecondL, typename SecondR>
BOOST_FUSION_GPU_ENABLED
inline bool
operator!=(pair<First, SecondL> const& l, pair<First, SecondR> const& r)
{
@ -140,6 +154,7 @@ namespace boost { namespace fusion
}
template <typename First, typename SecondL, typename SecondR>
BOOST_FUSION_GPU_ENABLED
inline bool
operator<(pair<First, SecondL> const& l, pair<First, SecondR> const& r)
{

View File

@ -7,6 +7,7 @@
#if !defined(BOOST_FUSION_SEGMENTED_FOLD_UNTIL_HPP_INCLUDED)
#define BOOST_FUSION_SEGMENTED_FOLD_UNTIL_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/fusion/support/detail/segmented_fold_until_impl.hpp>
@ -44,6 +45,7 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename State, typename Fun>
BOOST_FUSION_GPU_ENABLED
typename
lazy_disable_if<
is_const<Sequence>
@ -59,6 +61,7 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename State, typename Fun>
BOOST_FUSION_GPU_ENABLED
typename result_of::segmented_fold_until<Sequence const, State, Fun>::type
segmented_fold_until(Sequence const& seq, State const& state, Fun const& fun)
{

View File

@ -8,6 +8,7 @@
#if !defined(FUSION_SEQUENCE_BASE_04182005_0737)
#define FUSION_SEQUENCE_BASE_04182005_0737
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/begin_end_fwd.hpp>
namespace boost { namespace fusion

View File

@ -7,6 +7,7 @@
#if !defined(FUSION_TAG_OF_09232005_0845)
#define FUSION_TAG_OF_09232005_0845
#include <boost/fusion/support/config.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/fusion/support/tag_of_fwd.hpp>

View File

@ -7,6 +7,7 @@
#if !defined(BOOST_FUSION_SUPPORT_UNUSED_20070305_1038)
#define BOOST_FUSION_SUPPORT_UNUSED_20070305_1038
#include <boost/fusion/support/config.hpp>
#include <iosfwd>
#include <boost/config.hpp>
@ -21,16 +22,19 @@ namespace boost { namespace fusion
{
struct unused_type
{
BOOST_FUSION_GPU_ENABLED
unused_type()
{
}
template <typename T>
BOOST_FUSION_GPU_ENABLED
unused_type(T const&)
{
}
template <typename T>
BOOST_FUSION_GPU_ENABLED
unused_type const&
operator=(T const&) const
{
@ -38,18 +42,21 @@ namespace boost { namespace fusion
}
template <typename T>
BOOST_FUSION_GPU_ENABLED
unused_type&
operator=(T const&)
{
return *this;
}
BOOST_FUSION_GPU_ENABLED
unused_type const&
operator=(unused_type const&) const
{
return *this;
}
BOOST_FUSION_GPU_ENABLED
unused_type&
operator=(unused_type const&)
{
@ -63,16 +70,17 @@ namespace boost { namespace fusion
{
struct unused_only
{
BOOST_FUSION_GPU_ENABLED
unused_only(unused_type const&) {}
};
}
inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&)
BOOST_FUSION_GPU_ENABLED inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&)
{
return out;
}
inline std::istream& operator>>(std::istream& in, unused_type&)
BOOST_FUSION_GPU_ENABLED inline std::istream& operator>>(std::istream& in, unused_type&)
{
return in;
}