1 // RUN: %libomptarget-compile-run-and-check-generic
2 // RUN: %libomptarget-compileopt-run-and-check-generic
9 long unsigned **DP
= 0;
14 #pragma omp target map(from : DP)
15 DP
= (long unsigned **)malloc(sizeof(long unsigned *) * Threads
* Teams
);
17 #pragma omp target teams distribute parallel for num_teams(Teams) \
19 for (int i
= 0; i
< Threads
* Teams
; ++i
)
20 DP
[i
] = (long unsigned *)malloc(sizeof(long unsigned) * N
);
22 #pragma omp target teams distribute parallel for num_teams(Teams) \
24 for (int i
= 0; i
< Threads
* Teams
; ++i
) {
25 for (int j
= 0; j
< N
; ++j
) {
31 #pragma omp target teams distribute parallel for num_teams(Teams) \
32 thread_limit(Threads) reduction(+ : s)
33 for (int i
= 0; i
< Threads
* Teams
; ++i
) {
34 for (int j
= 0; j
< N
; ++j
) {
39 // CHECK: Sum: 203458478080
40 printf("Sum: %li\n", s
);