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
tasking
omp_task_shared.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run
2
#include <stdio.h>
3
#include <math.h>
4
#include "
omp_testsuite.h
"
5
6
/* Utility function do spend some time in a loop */
7
int
test_omp_task_imp_shared
()
8
{
9
int
i
;
10
int
k = 0;
11
int
result
= 0;
12
i
=0;
13
14
#pragma omp parallel
15
{
16
#pragma omp single
17
for
(k = 0; k <
NUM_TASKS
; k++) {
18
#pragma omp task shared(i)
19
{
20
#pragma omp atomic
21
i
++;
22
//this should be shared implicitly
23
}
24
}
25
}
26
result
=
i
;
27
return
((
result
==
NUM_TASKS
));
28
}
29
30
int
main
()
31
{
32
int
i
;
33
int
num_failed=0;
34
35
for
(
i
= 0;
i
<
REPETITIONS
;
i
++) {
36
if
(!
test_omp_task_imp_shared
()) {
37
num_failed++;
38
}
39
}
40
return
num_failed;
41
}
result
int result[2]
Definition:
cancellation_for_sections.c:13
i
#define i
Definition:
kmp_stub.cpp:87
test_omp_task_imp_shared
int test_omp_task_imp_shared()
Definition:
omp_task_shared.c:7
main
int main()
Definition:
omp_task_shared.c:30
omp_testsuite.h
NUM_TASKS
#define NUM_TASKS
Definition:
omp_testsuite.h:20
REPETITIONS
#define REPETITIONS
Definition:
omp_testsuite.h:13
Generated on Fri Feb 21 2025 14:11:14 for LLVM OpenMP by
1.9.6