LLVM OpenMP
20.0.0git
runtime
test
worksharing
for
bug_set_schedule_0.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run
2
3
#include <stdio.h>
4
#include <omp.h>
5
#include "
omp_testsuite.h
"
6
7
/* Test that the chunk size is set to default (1) when
8
chunk size <= 0 is specified */
9
int
a
= 0;
10
11
int
test_set_schedule_0
()
12
{
13
int
i
;
14
a
= 0;
15
omp_set_schedule
(
omp_sched_dynamic
,0);
16
17
#pragma omp parallel
18
{
19
#pragma omp for schedule(runtime)
20
for
(
i
= 0;
i
< 10;
i
++) {
21
#pragma omp atomic
22
a
++;
23
if
(
a
> 10)
24
exit(1);
25
}
26
}
27
return
a
==10;
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_set_schedule_0
()) {
37
num_failed++;
38
}
39
}
40
return
num_failed;
41
}
a
int a
Definition:
bug_set_schedule_0.c:9
test_set_schedule_0
int test_set_schedule_0()
Definition:
bug_set_schedule_0.c:11
main
int main()
Definition:
bug_set_schedule_0.c:30
omp_sched_dynamic
@ omp_sched_dynamic
Definition:
kmp.h:4505
i
#define i
Definition:
kmp_stub.cpp:87
omp_set_schedule
#define omp_set_schedule
Definition:
kmp_stub.cpp:30
omp_testsuite.h
REPETITIONS
#define REPETITIONS
Definition:
omp_testsuite.h:13
Generated on Wed Feb 19 2025 16:04:47 for LLVM OpenMP by
1.9.6