20 memset (arr, '\0', sizeof arr);
22 #pragma omp target enter data map(to: arr[0:100])
24 for (int i = 0; i < 100; i++)
29 #pragma omp target update to(*ptr)
31 for (int i = lo (); i < lo () + len (); i++)
34 #pragma omp target update to(arr[lo():len()])
36 #pragma omp target exit data map(from: arr[0:100])
38 assert (arr[10] == 10);
39 for (int i = lo (); i < lo () + len (); i++)
40 assert (arr[i] == i * 2);
49 memset (arr, '\0', sizeof arr);
51 #pragma omp target enter data map(to: arr[0:100])
53 for (int i = 0; i < 100; i++)
58 #pragma omp target update to(*ptr)
60 for (int i = lo (); i < lo () + len (); i++)
63 #pragma omp target update to(arr[lo():len()])
65 #pragma omp target exit data map(from: arr[0:100])
67 assert (arr[10] == 10);
68 for (int i = lo (); i < lo () + len (); i++)
69 assert (arr[i] == i * 2);