take into account use_mp flag
This commit is contained in:
@@ -106,6 +106,24 @@ op_sum::apply(Mat<typename T1::elem_type>& out, const Op< eOp<T1,eop_square>, op
|
||||
op_sum::apply_mat_square_noalias(out, U.M, dim);
|
||||
}
|
||||
}
|
||||
else
|
||||
if(arma_config::openmp && Proxy<inner_expr_type>::use_mp)
|
||||
{
|
||||
const quasi_unwrap<inner_expr_type> U(in.m); // force evaluation of compound inner expression
|
||||
|
||||
if(U.is_alias(out))
|
||||
{
|
||||
Mat<eT> tmp;
|
||||
|
||||
op_sum::apply_mat_noalias(tmp, U.M, dim);
|
||||
|
||||
out.steal_mem(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
op_sum::apply_mat_noalias(out, U.M, dim);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const Proxy<inner_expr_type> P(in.m);
|
||||
@@ -141,15 +159,37 @@ op_sum::apply(Mat<typename T1::elem_type>& out, const Op< eOp<T1,eop_pow>, op_su
|
||||
typedef Op< eOp<T1,eop_square>, op_sum > modified_whole_expr_type;
|
||||
|
||||
op_sum::apply(out, reinterpret_cast<const modified_whole_expr_type& >(in) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
typedef eOp<T1,eop_pow> inner_expr_type;
|
||||
|
||||
typedef typename inner_expr_type::proxy_type::stored_type inner_expr_P_stored_type;
|
||||
|
||||
const uword dim = in.aux_uword_a;
|
||||
|
||||
arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" );
|
||||
|
||||
if( (is_Mat<inner_expr_P_stored_type>::value) || (arma_config::openmp && Proxy<inner_expr_type>::use_mp) )
|
||||
{
|
||||
const quasi_unwrap<inner_expr_type> U(in.m); // force evaluation of eop_pow
|
||||
|
||||
if(U.is_alias(out))
|
||||
{
|
||||
Mat<eT> tmp;
|
||||
|
||||
op_sum::apply_mat_noalias(tmp, U.M, dim);
|
||||
|
||||
out.steal_mem(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
op_sum::apply_mat_noalias(out, U.M, dim);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const uword dim = in.aux_uword_a;
|
||||
|
||||
arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" );
|
||||
|
||||
typedef eOp<T1,eop_pow> inner_expr_type;
|
||||
|
||||
const Proxy<inner_expr_type> P(in.m);
|
||||
|
||||
if(P.is_alias(out))
|
||||
|
||||
Reference in New Issue
Block a user