nt::exp with SIMD

14 views
Skip to first unread message

sheng...@gmail.com

unread,
Nov 30, 2015, 3:21:34 AM11/30/15
to nt2-dev
Hi,
I am new to SIMD. The following code gave compiler error. Can you help me with this?
Thanks,
Steve


#include <boost/simd/sdk/simd/pack.hpp>
#include <boost/simd/sdk/simd/io.hpp>
#include <boost/simd/include/functions/splat.hpp>
#include <boost/simd/include/functions/plus.hpp>
#include <boost/simd/include/functions/multiplies.hpp>
#include <nt2/include/functions/exp.hpp>
#include <iostream>

int main()
{
  using namespace nt2;
  using namespace boost::simd;
  typedef boost::simd::pack<float> p_t;

  p_t res;
  p_t u(10);
  p_t r = boost::simd::splat<p_t>(11);

  res = (u + r) * 2.f;
  p_t res2 = nt2::exp<p_t>(res);  // <----- this line compiler error

}

It failed at the last line with the following error

/include/boost/simd/sdk/simd/pack/expression.hpp:54:7:   required from ‘typename boost::disable_if<boost::is_base_of<boost::simd::expression<Expression, ResultType>, Xpr>, boost::simd::expression<Expression, ResultType>&>::type boost::simd::expression<Expression, ResultType>::operator=(const Xpr&) [with Xpr = boost::simd::expression<boost::proto::exprns_::expr<nt2::tag::exp_, boost::proto::argsns_::list1<boost::simd::expression<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<const boost::simd::native<float, boost::simd::tag::sse_, void>&>, 0l>, const boost::simd::native<float, boost::simd::tag::sse_, void>&> >, 1l>, boost::simd::native<float, boost::simd::tag::sse_, void> >; Expr = boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::simd::native<float, boost::simd::tag::sse_, void> >, 0l>; ResultType = boost::simd::native<float, boost::simd::tag::sse_, void>; typename boost::disable_if<boost::is_base_of<boost::simd::expression<Expression, ResultType>, Xpr>, boost::simd::expression<Expression, ResultType>&>::type = boost::simd::expression<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::simd::native<float, boost::simd::tag::sse_, void> >, 0l>, boost::simd::native<float, boost::simd::tag::sse_, void> >&]’
/ctc/sw/v6/Vendor/boost_simd/linux64/3.1.0/include/boost/simd/sdk/simd/pack/pack.hpp:176:35:   required from ‘boost::simd::pack<Type, Cardinal>::pack(const T&, typename T::proto_is_expr_*) [with T = boost::simd::expression<boost::proto::exprns_::expr<nt2::tag::exp_, boost::proto::argsns_::list1<boost::simd::expression<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<const boost::simd::native<float, boost::simd::tag::sse_, void>&>, 0l>, const boost::simd::native<float, boost::simd::tag::sse_, void>&> >, 1l>, boost::simd::native<float, boost::simd::tag::sse_, void> >; Type = float; long unsigned int Cardinal = 4ul; typename T::proto_is_expr_ = void

Reply all
Reply to author
Forward
0 new messages