]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Vectorize one loop
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 29 Dec 2015 20:12:40 +0000 (21:12 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 29 Dec 2015 20:12:40 +0000 (21:12 +0100)
include/deal.II/lac/vector.templates.h

index d5a384ec47bb049e7e3848d9d82b7264c48210be..478f64f5343e96124648c307f5a043436a14b3bb 100644 (file)
@@ -795,11 +795,9 @@ namespace internal
                         const dealii::Vector<T> &src,
                         dealii::Vector<U>       &dst)
     {
-      const T *q = src.begin()+begin;
-      const T *const end_q = src.begin()+end;
-      U *p = dst.begin()+begin;
-      for (; q!=end_q; ++q, ++p)
-        *p = *q;
+      DEAL_II_OPENMP_SIMD_PRAGMA
+      for (unsigned int i=begin; i<end; ++i)
+        dst.begin()[i] = src.begin()[i];
     }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.