small speedup for lut += operator

This commit is contained in:
heckflosse
2016-04-23 22:45:40 +02:00
parent d153b55493
commit e61e488346

View File

@@ -258,14 +258,19 @@ public:
return *this;
}
// handy to sum up per thread histograms
// handy to sum up per thread histograms. #pragma omp simd speeds up the loop by about factor 3 for LUTu (unsigned int).
LUT<T> & operator+=(LUT<T> &rhs)
{
if (rhs.size == this->size) {
#ifdef _OPENMP
#pragma omp simd
#endif
for(unsigned int i = 0; i < this->size; i++) {
data[i] += rhs.data[i];
}
}
return *this;
}