0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ivdepとゆかいな仲間たち

Posted at

情報源

Intelコンパイラの#pragma ivdep相当の指示句は他のコンパイラにもあることが多いですが、だいたい別名です。以下のOpenMPのドキュメントに様々なバリエーションの記載がありました。

https://www.openmp.org/wp-content/uploads/OpenMP_SC20_Loop_Transformations.pdf

内容

上記内容と、一部記載のないものも加えた一覧です。


Cray
#pragma [_CRI] ivdep

SGI/Open64
#pragma ivdep

HP
#pragma IVDEP

Intel (iccは有効、icxでも有効かは不安)
#pragma ivdep

PGI
#pragma ivdep

gcc
#pragma GCC ivdep

msvc
#pragma loop(ivdep)

clang
#pragma clang loop vectorize(enable)

NEC (nc++)
#pragma _NEC ivdep

感想

ベクトル化/SIMD化しようとすると、ivdepは必須。個人的にはivdepよりもrestrictを使って個別に依存関係をコンパイラに伝えたい。とはいえ、restrictも対応状況がコンパイラ依存で、__restrict__restrict__などのバリエーションがある。また、特に困るのはstd::vectorに対してrestrict相当の明示をどうやるんだという問題があり、HPC等の速度が最重要の分野では、やっぱり生ポ最強なんじゃと思ってしまう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?