User and Reference Guide for the Intel® C++ Compiler 14.0
Creates a device data environment and then executes the construct on that device.
#pragma omp target [clause[, clause, ...]] |
structured-block
clause |
Can be any of the following clauses:
|
This pragma creates a device data environment and then executes the computation in the structured block on the device, using the device data environment. The encountering task waits for the computation to complete on the device before it proceeds. When an if(scalar-expression) evaluates to false, the structured block is executed on the host.
Example: Creating a device data environment and executing the structured block on the device |
|---|
#pragma omp target map(double dist, double x1, double y1, double x2, double y2)
{ dist = sqrt((x2 – x1)**2 + (y2 – y1)**2 ); } |