]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid overly cautious assertions in scatter
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 29 Mar 2017 09:18:44 +0000 (11:18 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 29 Mar 2017 09:18:44 +0000 (11:18 +0200)
include/deal.II/base/vectorization.h

index 8597851012e89e8568eced72802c7dc02380d091..7d42955f6448a4430b32ef22fdae9263071c5467 100644 (file)
@@ -1482,12 +1482,6 @@ public:
   void scatter (const unsigned int *offsets,
                 double             *base_ptr) const
   {
-    for (unsigned int i=0; i<4; ++i)
-      for (unsigned int j=i+1; j<4; ++j)
-        Assert(offsets[i] != offsets[j],
-               ExcMessage("Result of scatter undefined if two offset elements"
-                          " point to the same position"));
-
     // no scatter operation in AVX/AVX2
     for (unsigned int i=0; i<4; ++i)
       base_ptr[offsets[i]] = *(reinterpret_cast<const double *>(&data)+i);
@@ -1853,12 +1847,6 @@ public:
   void scatter (const unsigned int *offsets,
                 float              *base_ptr) const
   {
-    for (unsigned int i=0; i<8; ++i)
-      for (unsigned int j=i+1; j<8; ++j)
-        Assert(offsets[i] != offsets[j],
-               ExcMessage("Result of scatter undefined if two offset elements"
-                          " point to the same position"));
-
     // no scatter operation in AVX/AVX2
     for (unsigned int i=0; i<8; ++i)
       base_ptr[offsets[i]] = *(reinterpret_cast<const float *>(&data)+i);
@@ -2243,10 +2231,6 @@ public:
   void scatter (const unsigned int *offsets,
                 double             *base_ptr) const
   {
-    Assert(offsets[0] != offsets[1],
-           ExcMessage("Result of scatter undefined if two offset elements"
-                      " point to the same position"));
-
     for (unsigned int i=0; i<2; ++i)
       base_ptr[offsets[i]] = *(reinterpret_cast<const double *>(&data)+i);
   }
@@ -2567,12 +2551,6 @@ public:
   void scatter (const unsigned int *offsets,
                 float              *base_ptr) const
   {
-    for (unsigned int i=0; i<4; ++i)
-      for (unsigned int j=i+1; j<4; ++j)
-        Assert(offsets[i] != offsets[j],
-               ExcMessage("Result of scatter undefined if two offset elements"
-                          " point to the same position"));
-
     for (unsigned int i=0; i<4; ++i)
       base_ptr[offsets[i]] = *(reinterpret_cast<const float *>(&data)+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.