Hacker News new | ask | show | jobs
by TApplencourt 2485 days ago
In HPC, we use `#pragma omp simd`.

`#pragma omp imd` should force the vectorization, but maybe not the hoisting, I don't know. Could be nice to check.

Edit:

Clang fail: ``` <source>:5:5: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]

    #pragma omp simd 

    ^
1 warning generated. Compiler returned: 0 ```

But ICC seems happy with it.

1 comments

it works on my test:

   https://godbolt.org/z/sSSdjw
where ivdep fails. Nice!

You do need -fopenmp of course.

edit:

strangely, it still fails to vectorize the original vector example.