blob: b546d73d544a584273cef977e7471104342c8d1e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// RUN: %libomptarget-compile-generic && \
// RUN: %libomptarget-run-generic
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int num_devices = omp_get_num_devices();
// No target devices, just return
if (num_devices == 0) {
printf("PASS\n");
return 0;
}
double sum = 999;
double A = 311;
#pragma omp taskgroup task_reduction(+ : sum)
{
#pragma omp target map(to : A) in_reduction(+ : sum) device(0) nowait
{ sum += A; }
}
printf("PASS\n");
return EXIT_SUCCESS;
}
// CHECK: PASS
|