Esempio n. 1
0
    inline static void updateLineX(HOOD_NEW& hoodNew, int indexEnd, HOOD_OLD& hoodOld, unsigned /* nanoStep */)
    {
        for (; hoodOld.index() < indexEnd; ++hoodNew, ++hoodOld) {
            UnstructuredBusyworkCellWithUpdateLineX& self = *hoodNew;
            self = hoodOld[hoodOld.index()];

            for (int i = 0; i < ITERATIONS; ++i) {
                double cRealOld = self.cReal;
                self.cReal = self.cReal * self.cReal - self.cImag * self.cImag;
                self.cImag = 2 * self.cImag * cRealOld;
            }

            for (auto i = hoodOld.begin(); i != hoodOld.end(); ++i) {
                self.cReal += hoodOld[i.first()].x * i.second();
                self.cImag += hoodOld[i.first()].y * i.second();
            }
        }
    }
Esempio n. 2
0
 static void updateLineX(HOOD_NEW& hoodNew, int indexEnd, HOOD_OLD& hoodOld, unsigned /* nanoStep */)
 {
     for (int i = hoodOld.index(); i < indexEnd; ++i, ++hoodOld) {
         ShortVec tmp;
         tmp.load_aligned(&hoodNew->sum() + i * C);
         for (const auto& j: hoodOld.weights(0)) {
             ShortVec weights;
             ShortVec values;
             weights.load_aligned(j.second());
             values.gather(&hoodOld->value(), j.first());
             tmp += values * weights;
         }
         tmp.store_aligned(&hoodNew->sum() + i * C);
     }
 }
Esempio n. 3
0
 static void updateLineX(HOOD_NEW& hoodNew, int indexEnd, HOOD_OLD& hoodOld, unsigned /* nanoStep */)
 {
     for (int i = hoodOld.index(); i < indexEnd; ++i, ++hoodOld) {
         ShortVec tmp;
         tmp.load_aligned(&hoodNew->sum() + i * C);
         for (const auto& j: hoodOld.weights(0)) {
             ShortVec weights;
             ShortVec values;
             weights.load_aligned(j.second());
             // fixme: is this gahter actually correct? shouldn't we use offset 0 for the gather? see also hpxperformancetests/main.cpp
             values.gather(&hoodOld->value(), j.first());
             tmp += values * weights;
         }
         tmp.store_aligned(&hoodNew->sum() + i * C);
     }
 }