Re: [eigen] Eigen containers cannot be vectorized

[ Thread Index | Date Index | More Archives ]

The easy way to manage pragmas - standard or otherwise - in C99/C++11 code is to use #define and _Pragma.  Then you just have a header with e.g. PRAGMA_VECTORIZE in it that properly selects one of the supported options for each compiler.  The header to which I provided a Github link earlier in this thread is an example of this.

You can of course also #define to nothing when _Pragma isn't supported to support older compilers.



On Thu, Dec 8, 2016 at 1:35 PM, <fayard@xxxxxxxxxxxxx> wrote:
I agree, but there is no way to use restrict with containers. Maybe #pragma ivdep would be better, but it is not standard.

On 2016-12-08 22:05, Matthieu Brucher wrote:
Well, this pragma is still quite strong as it forces the compiler to
vectorize even when it thinks it should not do it.
The first pass should always be to use restrict first, check the
vectorizing reports and then force the vectorization with prior
knowledge (IMHO).



Jeff Hammond

Mail converted by MHonArc 2.6.19+