Re: [nt2-dev] nt2::exp with boost::simd::pack<float>

39 views
Skip to first unread message
Message has been deleted

Joel FALCOU

unread,
Nov 30, 2015, 3:26:55 AM11/30/15
to nt2...@googlegroups.com
hi

p_t res2 = nt2::exp(res);

is all you need to write.

Regards


On 30/11/2015 03:45, Shengxi Duan wrote:
> Hi,
> I am new to NT2, Can you help me with this compiler error
>
> 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>
>
>
>
> 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 with compiler error
>
> }
>
>
> 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]’
>
> --
> You received this message because you are subscribed to the Google
> Groups "nt2-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to nt2-dev+u...@googlegroups.com
> <mailto:nt2-dev+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Joel FALCOU

unread,
Nov 30, 2015, 8:19:51 AM11/30/15
to nt2...@googlegroups.com
That's a g++ bug.

You can fix it by adding

-DBOOST_SIMD_NO_STRICT_ALAISING -fno-strict-aliasing

to your command line.

On 30/11/2015 12:32, Shengxi Duan wrote:
> Joel,
> Thanks for your reply. I tried that
>
> p_t res2 = nt2::exp(res);
>
> and still got error:
>
> /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]’
> nt2_2.cpp:26:26: required from here
> /ctc/sw/v6/14.12/include/boost/type_traits/detail/cv_traits_impl.hpp:105:1:
> internal compiler error: in finish_member_declaration, at
> cp/semantics.c:2687
> {
> > an email to nt2-dev+u...@googlegroups.com <javascript:>
> > <mailto:nt2-dev+u...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
Message has been deleted
Message has been deleted

Joel FALCOU

unread,
Dec 2, 2015, 3:39:03 AM12/2/15
to nt2...@googlegroups.com


On 01/12/2015 21:00, Shengxi Duan wrote:
> Joel,
> Thanks again for your response.
> I tried your suggestion with g++4.8.3, still getting error (see below).
>
> However if I add a line that uses scalar version of nt2::exp before the
> line that uses simd version of nt2, then the program compiled ok with
> g++4.8.3.
>

This is indeed strange and incorrect. Let me dig into this a bit deeper.

Joel FALCOU

unread,
Dec 2, 2015, 3:40:43 AM12/2/15
to nt2...@googlegroups.com
Can you however send me the total log of error not just thix excerpt
and your full command line used to compile
Message has been deleted

Joel FALCOU

unread,
Dec 2, 2015, 9:41:16 AM12/2/15
to nt2...@googlegroups.com


On 02/12/2015 15:36, Shengxi Duan wrote:
>
> Joel,
>
> The command:
>
>
> g++ -DBOOST_SIMD_NO_STRICT_ALAISING -fno-strict-aliasing -std=c++11
> nt2_3.cpp -O3 -o nt2 -I$BOOST_SIMD_ROOT/3.1.0/include/ -I
> $BOOSTROOT/5.7/boost/include -I $NT2/3.1.0/include

must be -DBOOST_SIMD_NO_STRICT_ALIASING not
-DBOOST_SIMD_NO_STRICT_ALAISING

or is it a typo in the email ?
Message has been deleted

Joel FALCOU

unread,
Dec 2, 2015, 11:00:38 AM12/2/15
to nt2...@googlegroups.com
Sorry for that then ;)

On 02/12/2015 16:54, Shengxi Duan wrote:
> Joel,
> Yes, that worked. I copied the flag from your original post, which had
> the typo in it.
> Thanks a lot for your help.
>
> Steve
Reply all
Reply to author
Forward
0 new messages