Previous The reduction_vectorize.h |
Parent The vectorization of reduction |
Outline | Next The main_vectorize.cpp |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include "reduction_vectorize.h" ///Do the reduction /** @param ptabValue : input table * @param nbElement : number of elements in the input table * @return sum of all the elements of the input table */ float reduction(const float * __restrict__ ptabValue, long unsigned int nbElement){ const float* tabValue = (const float*)__builtin_assume_aligned(ptabValue, VECTOR_ALIGNEMENT); float res(0.0f); for(long unsigned int i(0lu); i < nbElement; ++i){ res += tabValue[i]; } return res; } |
Previous The reduction_vectorize.h |
Parent The vectorization of reduction |
Outline | Next The main_vectorize.cpp |