/* * @@name: target_struct_map.4 * @@type: C * @@operation: run * @@expect: success * @@version: omp_5.1 */ #include #include #define N 100 #define BAZILLION 2000000 struct foo { char buffera[BAZILLION]; char bufferb[BAZILLION]; float x; float a, b; float *p; }; #pragma omp begin declare target void saxpyfun(struct foo *S) { int i; for(i=0; ip[i] = S->p[i]*S->a + S->b; } #pragma omp end declare target int main() { struct foo S1, S2, S3; int i; // Case 1 S1.a = 2.0; S1.b = 4.0; S1.p = (float *)malloc(sizeof(float)*N); for(i=0; i