/* * @@name: target_struct_map.1c * @@type: C * @@compilable: yes * @@linkable: yes * @@expect: success */ #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 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 S; int i; S.a = 2.0; S.b = 4.0; S.p = (float *)malloc(sizeof(float)*N); for(i=0; i