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
affinity
disabled.c
Go to the documentation of this file.
1
// RUN: %libomp-compile
2
// RUN: env KMP_AFFINITY=disabled %libomp-run
3
// RUN: env KMP_AFFINITY=disabled,reset %libomp-run
4
// REQUIRES: affinity
5
#include <stdio.h>
6
#include <stdlib.h>
7
#include <omp.h>
8
9
int
main
() {
10
int
nthreads, correct_value;;
11
int
a
= 0;
12
#pragma omp parallel reduction(+: a)
13
{
14
a
+= omp_get_thread_num();
15
#pragma omp single
16
nthreads =
omp_get_num_threads
();
17
}
18
correct_value = nthreads * (nthreads - 1) / 2;
19
if
(
a
!= correct_value) {
20
printf(
"Incorrect value: %d should be %d\n"
,
a
, correct_value);
21
return
EXIT_FAILURE;
22
}
23
return
EXIT_SUCCESS;
24
}
25
main
int main()
Definition:
disabled.c:9
a
int a
Definition:
llvm-issue-80664.c:20
omp_get_num_threads
int omp_get_num_threads()
Generated on Mon Jun 9 2025 17:00:14 for LLVM OpenMP by
1.9.6