3 // Check explicit template copy map
10 #pragma acc parallel loop num_gangs (10) gang reduction (+:s) copy (array[0:n])
11 for (int i = 0; i < n; i++)
17 // Check implicit template copy map
19 template<typename T> T
25 for (int i = 0; i < n; i++)
28 #pragma acc parallel loop num_gangs (10) gang reduction (+:s)
29 for (int i = 0; i < n; i++)
35 // Check template with default (present)
37 template<typename T> T
38 sum_default_present ()
43 for (int i = 0; i < n; i++)
46 #pragma acc enter data copyin (array)
48 #pragma acc parallel loop num_gangs (10) gang reduction (+:s) default (present)
49 for (int i = 0; i < n; i++)
52 #pragma acc exit data delete (array)
57 // Check present and async
59 template<typename T> T
64 #pragma acc parallel loop num_gangs (10) gang async (1) present (array[0:n])
65 for (int i = 0; i < n; i++)
68 #pragma acc parallel loop num_gangs (10) gang reduction (+:s) present (array[0:n]) async wait (1)
69 for (int i = 0; i < n; i++)
77 // Check present and async and an explicit firstprivate
79 template<typename T> T
84 #pragma acc parallel loop num_gangs (10) gang reduction (+:s) firstprivate (c) async wait (1)
85 for (int i = 0; i < n; i++)
99 for (int i = 0; i < n; i++)
105 if (sum (a) != result)
108 if (sum<int> () != result)
111 if (sum_default_present<int> () != result)
114 #pragma acc enter data copyin (a)
115 if (async_sum (a) != result)
118 if (async_sum<int> (1) != result)
120 #pragma acc exit data delete (a)