We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86ad3af commit 7c040ecCopy full SHA for 7c040ec
openmp/runtime/test/scan/scan.f90
@@ -0,0 +1,25 @@
1
+! RUN: %flang %flags %openmp_flags -fopenmp-version=51 %s -o %t.exe
2
+! RUN: %t.exe | FileCheck %s --match-full-lines
3
+program inclusive_scan
4
+ implicit none
5
+ integer, parameter :: n = 100
6
+ integer a(n), b(n)
7
+ integer x, k, y, z
8
+
9
+ ! initialization
10
+ x = 0
11
+ do k = 1, n
12
+ a(k) = k
13
+ end do
14
15
+ ! a(k) is included in the computation of producing results in b(k)
16
+ !$omp parallel do reduction(inscan, +: x)
17
18
+ x = x + a(k)
19
+ !$omp scan inclusive(x)
20
+ b(k) = x
21
22
23
+ print *,'x =', x
24
+end program
25
+!CHECK: x = 5050
0 commit comments