#include #include int main() { const int N = 1000; int a[N], b[N], c[N]; for (int i = 0; i < N; ++i) { a[i] = i; b[i] = 2 * i; } #pragma omp target map(to: a[0:N], b[0:N]) map(from: c[0:N]) #pragma omp parallel for for (int i = 0; i < N; ++i) { c[i] = a[i] + b[i]; } std::cout << "Result: " << c[0] << ", " << c[N-1] << std::endl; return 0; }