インテル® C++ コンパイラー 16.0 ユーザー・リファレンス・ガイド

omp declare target

target 領域から呼び出せる関数のデバイス固有バージョンを作成します。このプラグマは、インテル® MIC アーキテクチャーにのみ適用されます。

構文

#pragma omp declare target

function-definition-or-declaration

#pragma omp end declare target

引数

なし

説明

omp declare target プラグマ文と omp end declare target プラグマ文の間で宣言された関数は、デバイスで実行するターゲット領域内で使用できます。

宣言された関数を target 領域で使用する例

#pragma omp declare target
  int FirstFunction(int a);
  int SecondFunction(int a);
#pragma omp end declare target
  ...

#pragma omp target {
  ...
  x = FirstFunction(a) * SecondFunction(a);
  ...
}