LLVM OpenMP
20.0.0git
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
c
d
e
g
h
i
m
n
p
r
s
t
u
Functions
c
d
e
g
i
m
n
p
r
s
u
Variables
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
w
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
_
a
b
c
d
e
i
k
l
m
n
o
p
r
t
u
Enumerations
_
b
c
d
f
k
l
n
o
s
t
Enumerator
_
a
b
c
d
e
f
k
l
n
o
p
r
s
t
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
runtime
test
worksharing
for
omp_for_non_rectangular.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run
2
3
// Support for collapse of non-rectangular loop nests was added in GCC 11
4
// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7, gcc-8, gcc-9, gcc-10
5
6
#define N 10
7
int
arr
[
N
][
N
][
N
];
8
9
int
collapsed
(
int
mp) {
10
int
Cnt = 0;
11
#pragma omp for collapse(3)
12
for
(
int
j
= 0;
j
< mp; ++
j
) {
13
for
(
int
i
=
j
;
i
< mp; ++
i
) {
14
for
(
int
i0 = 0; i0 <
N
; ++i0) {
15
arr
[
j
][
i
][i0] = 1;
16
++Cnt;
17
}
18
}
19
}
20
return
Cnt;
21
}
22
23
int
test
(
int
mp) {
24
int
Failed = 0;
25
for
(
int
j
= 0;
j
< mp; ++
j
) {
26
for
(
int
i
= 0;
i
< mp; ++
i
) {
27
for
(
int
i0 = 0; i0 <
N
; ++i0) {
28
if
((
i
<
j
&&
arr
[
j
][
i
][i0] == 0) || (
i
>=
j
&&
arr
[
j
][
i
][i0] == 1))
29
continue
;
30
++Failed;
31
}
32
}
33
}
34
return
Failed;
35
}
36
37
int
main
() {
38
int
Res =
collapsed
(
N
);
39
return
Res ==
N
* (
N
+ 1) &&
test
(
N
) == 0;
40
}
i
#define i
Definition:
kmp_stub.cpp:87
N
#define N
Definition:
omp_for_non_rectangular.c:6
collapsed
int collapsed(int mp)
Definition:
omp_for_non_rectangular.c:9
arr
int arr[N][N][N]
Definition:
omp_for_non_rectangular.c:7
main
int main()
Definition:
omp_for_non_rectangular.c:37
test
int test(int mp)
Definition:
omp_for_non_rectangular.c:23
j
int j
Definition:
omp_single_copyprivate.c:6
Generated on Sun Jun 15 2025 06:09:33 for LLVM OpenMP by
1.9.6