Intel® C++ Compiler 16.0 User and Reference Guide

omp declare target

Creates a device-specific version of a function that can be called from a target region. This pragma only applies to Intel® MIC Architecture.

Syntax

#pragma omp declare target

function-definition-or-declaration

#pragma omp end declare target

Arguments

None.

Description

Any of the declared functions that appear between the omp declare target pragma and the omp end declare target pragma statements can be used inside a target region that executes on the device.

Example: Using declared functions in a subsequent target region

#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);
  ...
}