Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

get rid of the data abstraction layer by having direcly in a terminal…

… either a native or a boost::array. WIP.
  • Loading branch information...
commit 18c4f19295acd718a842aab64b3f4e2dc5919901 1 parent 976bad0
Mathieu- authored
View
6 modules/boost/simd/sdk/include/boost/simd/sdk/simd/pack/call.hpp
@@ -23,12 +23,12 @@ namespace boost { namespace simd { namespace ext
(scalar_< integer_<Data> >)
)
{
- typedef typename Value::parent result_type;
+ typedef Value result_type;
inline result_type
operator()( Value const& v, State const& , Data const& ) const
{
- return v.value();
+ return v;
}
};
@@ -40,7 +40,7 @@ namespace boost { namespace simd { namespace ext
(scalar_< integer_<Data> >)
)
{
- typedef typename Value::parent::value_type result_type;
+ typedef typename Value::value_type result_type;
inline result_type
operator()( Value const& v, State const&, Data const& p ) const
View
4 modules/boost/simd/sdk/include/boost/simd/sdk/simd/pack/expression.hpp
@@ -18,7 +18,7 @@ namespace boost { namespace simd
////////////////////////////////////////////////////////////////////////////
// Here is the domain-specific expression wrapper
////////////////////////////////////////////////////////////////////////////
- template<class Expr,class Type,class Cardinal>
+ template<class Expr,class Type,class Cardinal,class Dummy>
struct expression
{
BOOST_PROTO_BASIC_EXTENDS_TPL(Expr, (expression<Expr, Type, Cardinal>)
@@ -33,7 +33,7 @@ namespace boost { namespace simd
////////////////////////////////////////////////////////////////////////////
// FusionRandomAccessSequence interface
////////////////////////////////////////////////////////////////////////////
- typedef data<Type,Cardinal> data_type;
+ typedef pack<Type,Cardinal::value> data_type;
typedef typename data_type::value_type value_type;
typedef typename data_type::reference reference;
typedef typename data_type::const_reference const_reference;
View
1  modules/boost/simd/sdk/include/boost/simd/sdk/simd/pack/forward.hpp
@@ -20,6 +20,7 @@ namespace boost { namespace simd
template< class Expression
, class Type
, class Cardinal
+ , class Dummy = boost::proto::is_proto_expr
@mgaunard Collaborator

Please avoid inserting tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
>
struct expression;
View
3  modules/boost/simd/sdk/include/boost/simd/sdk/simd/pack/grammar.hpp
@@ -51,7 +51,8 @@ namespace boost { namespace simd
template<class T, class N> template<class Dummy>
struct grammar_cases<T,N>::case_<dispatch::tag::terminal_, Dummy>
: boost::proto::
- or_ < boost::proto::terminal< data<T,N> >
+ or_ < boost::proto::terminal< native<T,boost::proto::_> >
+ , boost::proto::terminal< boost::array<T, boost::proto::N> >
, boost::proto::terminal< dispatch::meta::constant_<boost::proto::_> >
, boost::proto::
and_< boost::proto::terminal<boost::proto::_>
View
27 modules/boost/simd/sdk/include/boost/simd/sdk/simd/pack/pack.hpp
@@ -25,10 +25,12 @@ namespace boost { namespace simd
struct pack
{
BOOST_PROTO_BASIC_EXTENDS_TPL( (typename boost::proto::
- terminal< data< Type
- , boost::mpl::size_t<Cardinal>
- >
- >::type)
+ terminal< typename meta::
+ vector_of< Type
+ , boost::mpl::
+ size_t<Cardinal>::value
+ >::type
+ >::type)
, (pack<Type,Cardinal>)
, (domain<Type,boost::mpl::size_t<Cardinal> >))
@@ -43,7 +45,7 @@ namespace boost { namespace simd
////////////////////////////////////////////////////////////////////////////
// Data holder of pack terminals
////////////////////////////////////////////////////////////////////////////
- typedef data<Type,boost::mpl::size_t<Cardinal> > data_type;
+ typedef typename meta::vector_of<Type, boost::mpl::size_t<Cardinal>::value >::type data_type;
////////////////////////////////////////////////////////////////////////////
// expression hierarchy of simd:::expression
@@ -55,7 +57,7 @@ namespace boost { namespace simd
////////////////////////////////////////////////////////////////////////////
// Range interface
////////////////////////////////////////////////////////////////////////////
- typedef typename data_type::parent base_type;
+ //typedef typename data_type::parent base_type;
typedef typename data_type::value_type value_type;
typedef typename data_type::reference reference;
typedef typename data_type::const_reference const_reference;
@@ -66,7 +68,7 @@ namespace boost { namespace simd
////////////////////////////////////////////////////////////////////////////
// Array interface
////////////////////////////////////////////////////////////////////////////
- BOOST_STATIC_CONSTANT(size_type, static_size = base_type::static_size);
+ BOOST_STATIC_CONSTANT(size_type, static_size = data_type::static_size);
////////////////////////////////////////////////////////////////////////////
// Assignments
@@ -108,20 +110,25 @@ namespace boost { namespace simd
////////////////////////////////////////////////////////////////////////////
data_type const& value() const { return boost::proto::value(*this); }
+ template<class X> void evaluate(X const& xpr)
+ {
+ boost::simd::evaluate(boost::proto::value(*this), xpr);
+ }
+
////////////////////////////////////////////////////////////////////////////
// SIMD expression evaluates as pack in assignment context
// TODO: fix to use obliviosu AST evaluation
////////////////////////////////////////////////////////////////////////////
template<class X> pack& operator=(X const& xpr )
{
- boost::proto::value(*this).evaluate(xpr);
+ evaluate(xpr);
return *this;
}
- #define BOOST_SIMD_MAKE_ASSIGN_OP(OP) \
+ #define BOOST_SIMD_MAKE_ASSIGN_OP(OP) \
template<class X> pack& operator BOOST_PP_CAT(OP,=)(X const& xpr ) \
{ \
- boost::proto::value(*this).evaluate(*this OP xpr); \
+ evaluate(*this OP xpr); \
return *this; \
} \
/**/
Please sign in to comment.
Something went wrong with that request. Please try again.