Loading src/TNL/Containers/Expressions/HorizontalOperations.h +54 −28 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ struct Addition { return a + b; } /* __cuda_callable__ static auto evaluate( const T1& a, T2&& b ) -> decltype( a + b ) { Loading @@ -43,7 +43,7 @@ struct Addition { return std::forward<T1>(a) + std::forward<T1>(b); } */ }; template< typename T1, typename T2 > Loading @@ -54,7 +54,7 @@ struct Subtraction { return a - b; } /* __cuda_callable__ static auto evaluate( const T1& a, T2&& b ) -> decltype( a - b ) { Loading @@ -73,6 +73,7 @@ struct Subtraction { return std::forward<T1>(a) - std::forward<T1>(b); } */ }; template< typename T1, typename T2 > Loading @@ -83,7 +84,7 @@ struct Multiplication { return a * b; } /* __cuda_callable__ static auto evaluate( const T1& a, T2&& b ) -> decltype( a * b ) { Loading @@ -102,6 +103,7 @@ struct Multiplication { return std::forward<T1>(a) * std::forward<T1>(b); } */ }; template< typename T1, typename T2 > Loading @@ -112,7 +114,7 @@ struct Division { return a / b; } /* __cuda_callable__ static auto evaluate( const T1& a, T2&& b ) -> decltype( a / b ) { Loading @@ -131,6 +133,7 @@ struct Division { return std::forward<T1>(a) / std::forward<T1>(b); } */ }; template< typename T1, typename T2 > Loading Loading @@ -161,12 +164,13 @@ struct Minus { return -a; } /* __cuda_callable__ static T1 evaluate( T1&& a ) { return -(std::forward<T1>(a)); } */ }; template< typename T1 > Loading Loading @@ -194,12 +198,13 @@ struct Pow { return TNL::pow( a, exp ); } /* __cuda_callable__ static auto evaluate( T1&& a, const T2& exp ) -> decltype( TNL::pow( a, exp ) ) { return TNL::pow( std::forward<T1>(a), exp ); } */ }; template< typename T1 > Loading @@ -210,12 +215,13 @@ struct Exp { return TNL::exp( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::exp( a ) ) { return TNL::exp( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -226,12 +232,13 @@ struct Sqrt { return TNL::sqrt( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::sqrt( a ) ) { return TNL::sqrt( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -242,12 +249,13 @@ struct Cbrt { return TNL::cbrt( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::cbrt( a ) ) { return TNL::cbrt( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -258,12 +266,13 @@ struct Log { return TNL::log( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::log( a ) ) { return TNL::log( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -274,12 +283,13 @@ struct Log10 { return TNL::log10( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::log10( a ) ) { return TNL::log10( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -290,12 +300,13 @@ struct Log2 { return TNL::log2( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::log2( a ) ) { return TNL::log2( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -306,12 +317,13 @@ struct Sin { return TNL::sin( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::sin( a ) ) { return TNL::sin( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -322,12 +334,13 @@ struct Cos { return TNL::cos( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::cos( a ) ) { return TNL::cos( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -338,12 +351,13 @@ struct Tan { return TNL::tan( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::tan( a ) ) { return TNL::tan( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -354,12 +368,13 @@ struct Asin { return TNL::asin( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::asin( a ) ) { return TNL::asin( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -370,12 +385,13 @@ struct Acos { return TNL::acos( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::acos( a ) ) { return TNL::acos( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -386,12 +402,13 @@ struct Atan { return TNL::atan( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::atan( a ) ) { return TNL::atan( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -402,12 +419,13 @@ struct Sinh { return TNL::sinh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::sinh( a ) ) { return TNL::sinh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -418,12 +436,13 @@ struct Cosh { return TNL::cosh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::cosh( a ) ) { return TNL::cosh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -434,12 +453,13 @@ struct Tanh { return TNL::tanh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::tanh( a ) ) { return TNL::tanh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -450,12 +470,13 @@ struct Asinh { return TNL::asinh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::asinh( a ) ) { return TNL::asinh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -466,12 +487,13 @@ struct Acosh { return TNL::acosh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::acosh( a ) ) { return TNL::acosh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -482,12 +504,13 @@ struct Atanh { return TNL::atanh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::atanh( a ) ) { return TNL::atanh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -498,12 +521,13 @@ struct Floor { return TNL::floor( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::floor( a ) ) { return TNL::floor( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -514,12 +538,13 @@ struct Ceil { return TNL::ceil( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::ceil( a ) ) { return TNL::ceil( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -530,12 +555,13 @@ struct Sign { return TNL::sign( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::sign( a ) ) { return TNL::sign( std::forward<T1>(a) ); } */ }; template< typename ResultType > Loading src/TNL/Containers/VectorExpressions.h +4 −2 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ operator+( ET&& a, const Vector< Real, Device, Index, Allocator >& b ) return Expressions::BinaryExpressionTemplate< ET, ConstView, Expressions::Addition >( a, b.getConstView() ); }*/ /* template< typename ET, typename Real, typename Device, typename Index, typename Allocator, typename..., typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value > > auto Loading @@ -59,6 +59,7 @@ operator+( const ET& a, Vector< Real, Device, Index, Allocator >&& b ) using View = typename Vector< Real, Device, Index, Allocator >::ViewType; return Expressions::BinaryExpressionTemplate< ET, View, Expressions::Addition >( a, b.getView() ); } */ template< typename Real1, typename Real2, typename Device, typename Index, typename Allocator > auto Loading @@ -69,7 +70,7 @@ operator+( const Vector< Real1, Device, Index, Allocator >& a, const Vector< Rea return Expressions::BinaryExpressionTemplate< ConstView1, ConstView2, Expressions::Addition >( a.getConstView(), b.getConstView() ); } /* template< typename Real1, typename Real2, typename Device, typename Index, typename Allocator > auto operator+( Vector< Real1, Device, Index, Allocator >&& a, const Vector< Real2, Device, Index, Allocator >& b ) Loading @@ -87,6 +88,7 @@ operator+( const Vector< Real1, Device, Index, Allocator >& a, Vector< Real2, De using View2 = typename Vector< Real2, Device, Index, Allocator >::ViewType; return Expressions::BinaryExpressionTemplate< ConstView1, View2, Expressions::Addition >( a.getConstView(), b.getView() ); } */ template< typename Real1, typename Real2, typename Device, typename Index, typename Allocator > auto Loading Loading
src/TNL/Containers/Expressions/HorizontalOperations.h +54 −28 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ struct Addition { return a + b; } /* __cuda_callable__ static auto evaluate( const T1& a, T2&& b ) -> decltype( a + b ) { Loading @@ -43,7 +43,7 @@ struct Addition { return std::forward<T1>(a) + std::forward<T1>(b); } */ }; template< typename T1, typename T2 > Loading @@ -54,7 +54,7 @@ struct Subtraction { return a - b; } /* __cuda_callable__ static auto evaluate( const T1& a, T2&& b ) -> decltype( a - b ) { Loading @@ -73,6 +73,7 @@ struct Subtraction { return std::forward<T1>(a) - std::forward<T1>(b); } */ }; template< typename T1, typename T2 > Loading @@ -83,7 +84,7 @@ struct Multiplication { return a * b; } /* __cuda_callable__ static auto evaluate( const T1& a, T2&& b ) -> decltype( a * b ) { Loading @@ -102,6 +103,7 @@ struct Multiplication { return std::forward<T1>(a) * std::forward<T1>(b); } */ }; template< typename T1, typename T2 > Loading @@ -112,7 +114,7 @@ struct Division { return a / b; } /* __cuda_callable__ static auto evaluate( const T1& a, T2&& b ) -> decltype( a / b ) { Loading @@ -131,6 +133,7 @@ struct Division { return std::forward<T1>(a) / std::forward<T1>(b); } */ }; template< typename T1, typename T2 > Loading Loading @@ -161,12 +164,13 @@ struct Minus { return -a; } /* __cuda_callable__ static T1 evaluate( T1&& a ) { return -(std::forward<T1>(a)); } */ }; template< typename T1 > Loading Loading @@ -194,12 +198,13 @@ struct Pow { return TNL::pow( a, exp ); } /* __cuda_callable__ static auto evaluate( T1&& a, const T2& exp ) -> decltype( TNL::pow( a, exp ) ) { return TNL::pow( std::forward<T1>(a), exp ); } */ }; template< typename T1 > Loading @@ -210,12 +215,13 @@ struct Exp { return TNL::exp( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::exp( a ) ) { return TNL::exp( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -226,12 +232,13 @@ struct Sqrt { return TNL::sqrt( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::sqrt( a ) ) { return TNL::sqrt( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -242,12 +249,13 @@ struct Cbrt { return TNL::cbrt( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::cbrt( a ) ) { return TNL::cbrt( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -258,12 +266,13 @@ struct Log { return TNL::log( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::log( a ) ) { return TNL::log( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -274,12 +283,13 @@ struct Log10 { return TNL::log10( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::log10( a ) ) { return TNL::log10( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -290,12 +300,13 @@ struct Log2 { return TNL::log2( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::log2( a ) ) { return TNL::log2( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -306,12 +317,13 @@ struct Sin { return TNL::sin( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::sin( a ) ) { return TNL::sin( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -322,12 +334,13 @@ struct Cos { return TNL::cos( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::cos( a ) ) { return TNL::cos( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -338,12 +351,13 @@ struct Tan { return TNL::tan( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::tan( a ) ) { return TNL::tan( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -354,12 +368,13 @@ struct Asin { return TNL::asin( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::asin( a ) ) { return TNL::asin( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -370,12 +385,13 @@ struct Acos { return TNL::acos( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::acos( a ) ) { return TNL::acos( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -386,12 +402,13 @@ struct Atan { return TNL::atan( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::atan( a ) ) { return TNL::atan( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -402,12 +419,13 @@ struct Sinh { return TNL::sinh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::sinh( a ) ) { return TNL::sinh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -418,12 +436,13 @@ struct Cosh { return TNL::cosh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::cosh( a ) ) { return TNL::cosh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -434,12 +453,13 @@ struct Tanh { return TNL::tanh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::tanh( a ) ) { return TNL::tanh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -450,12 +470,13 @@ struct Asinh { return TNL::asinh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::asinh( a ) ) { return TNL::asinh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -466,12 +487,13 @@ struct Acosh { return TNL::acosh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::acosh( a ) ) { return TNL::acosh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -482,12 +504,13 @@ struct Atanh { return TNL::atanh( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::atanh( a ) ) { return TNL::atanh( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -498,12 +521,13 @@ struct Floor { return TNL::floor( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::floor( a ) ) { return TNL::floor( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -514,12 +538,13 @@ struct Ceil { return TNL::ceil( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::ceil( a ) ) { return TNL::ceil( std::forward<T1>(a) ); } */ }; template< typename T1 > Loading @@ -530,12 +555,13 @@ struct Sign { return TNL::sign( a ); } /* __cuda_callable__ static auto evaluate( T1&& a ) -> decltype( TNL::sign( a ) ) { return TNL::sign( std::forward<T1>(a) ); } */ }; template< typename ResultType > Loading
src/TNL/Containers/VectorExpressions.h +4 −2 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ operator+( ET&& a, const Vector< Real, Device, Index, Allocator >& b ) return Expressions::BinaryExpressionTemplate< ET, ConstView, Expressions::Addition >( a, b.getConstView() ); }*/ /* template< typename ET, typename Real, typename Device, typename Index, typename Allocator, typename..., typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value > > auto Loading @@ -59,6 +59,7 @@ operator+( const ET& a, Vector< Real, Device, Index, Allocator >&& b ) using View = typename Vector< Real, Device, Index, Allocator >::ViewType; return Expressions::BinaryExpressionTemplate< ET, View, Expressions::Addition >( a, b.getView() ); } */ template< typename Real1, typename Real2, typename Device, typename Index, typename Allocator > auto Loading @@ -69,7 +70,7 @@ operator+( const Vector< Real1, Device, Index, Allocator >& a, const Vector< Rea return Expressions::BinaryExpressionTemplate< ConstView1, ConstView2, Expressions::Addition >( a.getConstView(), b.getConstView() ); } /* template< typename Real1, typename Real2, typename Device, typename Index, typename Allocator > auto operator+( Vector< Real1, Device, Index, Allocator >&& a, const Vector< Real2, Device, Index, Allocator >& b ) Loading @@ -87,6 +88,7 @@ operator+( const Vector< Real1, Device, Index, Allocator >& a, Vector< Real2, De using View2 = typename Vector< Real2, Device, Index, Allocator >::ViewType; return Expressions::BinaryExpressionTemplate< ConstView1, View2, Expressions::Addition >( a.getConstView(), b.getView() ); } */ template< typename Real1, typename Real2, typename Device, typename Index, typename Allocator > auto Loading