Commit 8b9a2151 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed argMin and argMax for static expressions

parent 72fc00b7
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
@@ -2359,6 +2359,28 @@ min( const Containers::Expressions::StaticUnaryExpressionTemplate< L1, LOperatio
   return StaticExpressionMin( a );
}

template< typename L1,
          typename L2,
          template< typename, typename > class LOperation,
          typename Index >
__cuda_callable__
auto
argMin( const Containers::Expressions::StaticBinaryExpressionTemplate< L1, L2, LOperation >& a, Index& arg )
{
   return StaticExpressionArgMin( a, arg );
}

template< typename L1,
          template< typename > class LOperation,
          typename LParameter,
          typename Index >
__cuda_callable__
auto
argMin( const Containers::Expressions::StaticUnaryExpressionTemplate< L1, LOperation, LParameter >& a, Index& arg )
{
   return StaticExpressionArgMin( a, arg );
}

template< typename L1,
          typename L2,
          template< typename, typename > class LOperation >
@@ -2379,6 +2401,28 @@ max( const Containers::Expressions::StaticUnaryExpressionTemplate< L1, LOperatio
   return StaticExpressionMax( a );
}

template< typename L1,
          typename L2,
          template< typename, typename > class LOperation,
          typename Index >
__cuda_callable__
auto
argMax( const Containers::Expressions::StaticBinaryExpressionTemplate< L1, L2, LOperation >& a, Index& arg )
{
   return StaticExpressionArgMax( a, arg );
}

template< typename L1,
          template< typename > class LOperation,
          typename LParameter,
          typename Index >
__cuda_callable__
auto
argMax( const Containers::Expressions::StaticUnaryExpressionTemplate< L1, LOperation, LParameter >& a, Index& arg )
{
   return StaticExpressionArgMax( a, arg );
}

template< typename L1,
          typename L2,
          template< typename, typename > class LOperation >
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ auto StaticExpressionMin( const Expression& expression )
   return aux;
}

template< typename Expression, typename Real >
template< typename Expression >
__cuda_callable__
auto StaticExpressionArgMin( const Expression& expression, int& arg )
{
@@ -58,7 +58,7 @@ auto StaticExpressionMax( const Expression& expression )
   return aux;
}

template< typename Expression, typename Real >
template< typename Expression >
__cuda_callable__
auto StaticExpressionArgMax( const Expression& expression, int& arg )
{