From e61e4883464370fc31296ca7b38c9f4122fa2cd9 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 23 Apr 2016 22:45:40 +0200 Subject: [PATCH] small speedup for lut += operator --- rtengine/LUT.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index b128d89b8..76bcf0ccd 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -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 & operator+=(LUT &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; }