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

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

c# - Convert XDocument to byte array (and byte array to XDocument) -