/* * @@name: teams.1 * @@type: C * @@operation: compile * @@expect: success * @@version: omp_4.0 */ #include #include float dotprod(float B[], float C[], int N) { float sum0 = 0.0; float sum1 = 0.0; #pragma omp target map(to: B[:N], C[:N]) map(tofrom: sum0, sum1) #pragma omp teams num_teams(2) { int i; if (omp_get_num_teams() != 2) abort(); if (omp_get_team_num() == 0) { #pragma omp parallel for reduction(+:sum0) for (i=0; i