Hi All,

I was digging around lac/vectorized_operations_internal.h 
<https://github.com/dealii/dealii/blob/master/include/deal.II/lac/vector_operations_internal.h>
 
and noticed that objects that are used in SIMD to do reduction are of the 
form:

template <typename Number, typename Number2>

  struct Dot
  {    
    VectorizedArray<Number>
    do_vectorized(const size_type i) const
    {
      VectorizedArray<Number> x, y;
      x.load(X+i);
      y.load(Y+i);
      return x * y;
    }

    const Number  *X;

    const Number2 *Y;
 }

which are used like

        VectorizedArray<Number> r0 = op.do_vectorized(index);
        VectorizedArray<Number> r1 = op.do_vectorized(index+nvecs);
        VectorizedArray<Number> r2 = op.do_vectorized(index+2*nvecs);
        VectorizedArray<Number> r3 = op.do_vectorized(index+3*nvecs);

where 

const unsigned int nvecs = VectorizedArray<Number>::n_array_elements;


I wonder should not declarations be moved to the class variable as *mutable*
?
I don't know internals of VectorizedArray, but i would assume that 
currently it allocates memory for the two variables on each call to 
do_vectorized(),
which would not be the case otherwise.

Regards,
Denis.

-- 
You received this message because you are subscribed to the Google Groups 
"deal.II developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to