c++ - auto vectorization - array reduction -


i'm trying vectorize simple reduction loop:

#ifndef poissonsolverjacobi_hpp #define poissonsolverjacobi_hpp #include <stdlib.h>  class p{ public:     p();      void iterate();    protected:     float* m_func;     unsigned int m_maxit; };  p::p(){ m_func=(float*)calloc(5000,sizeof(float)); m_maxit=5000; }  void p::iterate(){ float err(0.);   for(unsigned int i(0);i< m_maxit;i++){     err+=m_func[i]; }  }  #endif 

using following compiling command gcc 4.6.3 -march=x86_64:

g++ -c -o3 -msse2 -ftree-vectorizer-verbose=2 -fassociative-math -funsafe-math-optimizations 

could me point out why fails?


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -