By: Freddie (freddie.delete@this.witherden.org), May 21, 2022 6:13 am
Room: Moderated Discussions
Jan Wassenberg (jan.wassenberg.delete@this.gmail.com) on May 20, 2022 10:12 pm wrote:
> Jörn Engel (joern.delete@this.purestorage.com) on May 17, 2022 5:14 pm wrote:
> > Charlie Burnes (charlie.burnes.delete@this.no-spam.com) on May 17, 2022 4:05 pm wrote:
> > > OpenMP is most known for shared memory multiprocessing but SIMD directives were added in 2013
> > > with OpenMP 4.0. One advantage of using OpenMP SIMD directives is that the source code can make
> > > use of AVX512 when it is present and the code still runs on processors that do not have AVX512.
> > > Another advantage is the programmer does not have to handle the case were the loop iteration
> > > count is not a multiple of the SIMD width. That code gets generated automatically.
> >
> > Doesn't excite me very much, to be honest. But if you find
> > it useful for your projects, don't let my opinion stop you.
>
> To expand on this a bit, I believe omp simd has a (near-)total lack of operations that cannot
> be expressed as C++ operators. By contrast, Highway provides about 100 such ops:
>
> https://github.com/google/highway/blob/master/g3doc/quick_reference.md#operations
The primary advantage of #pragma omp simd is that it provides a vendor neutral means of stating that a loop can be vectorized. Without it one has to rely on compiler extensions such as #pragma ivdep and #pragma GCC ivdep. Many loops which compilers would otherwise fail to vectorize, or do so inefficiently, or with require extra preamble checks, generate relatively clean code with #pragma omp simd.
> Jörn Engel (joern.delete@this.purestorage.com) on May 17, 2022 5:14 pm wrote:
> > Charlie Burnes (charlie.burnes.delete@this.no-spam.com) on May 17, 2022 4:05 pm wrote:
> > > OpenMP is most known for shared memory multiprocessing but SIMD directives were added in 2013
> > > with OpenMP 4.0. One advantage of using OpenMP SIMD directives is that the source code can make
> > > use of AVX512 when it is present and the code still runs on processors that do not have AVX512.
> > > Another advantage is the programmer does not have to handle the case were the loop iteration
> > > count is not a multiple of the SIMD width. That code gets generated automatically.
> >
> > Doesn't excite me very much, to be honest. But if you find
> > it useful for your projects, don't let my opinion stop you.
>
> To expand on this a bit, I believe omp simd has a (near-)total lack of operations that cannot
> be expressed as C++ operators. By contrast, Highway provides about 100 such ops:
>
> https://github.com/google/highway/blob/master/g3doc/quick_reference.md#operations
The primary advantage of #pragma omp simd is that it provides a vendor neutral means of stating that a loop can be vectorized. Without it one has to rely on compiler extensions such as #pragma ivdep and #pragma GCC ivdep. Many loops which compilers would otherwise fail to vectorize, or do so inefficiently, or with require extra preamble checks, generate relatively clean code with #pragma omp simd.