LLVM OpenMP
20.0.0git
runtime
test
ompt
synchronization
reduction
empty_reduce.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run | FileCheck %s
2
// RUN: %libomp-compile -DNOWAIT && %libomp-run | FileCheck %s
3
// REQUIRES: ompt
4
// UNSUPPORTED: gcc
5
#include "
callback.h
"
6
#include <omp.h>
7
8
#ifdef NOWAIT
9
#define FOR_CLAUSE nowait
10
#else
11
#define FOR_CLAUSE
12
#endif
13
14
int
main
() {
15
int
sum
= 0;
16
int
i
;
17
#pragma omp parallel num_threads(1)
18
#pragma omp for reduction(+ : sum) FOR_CLAUSE
19
for
(
i
= 0;
i
< 10000;
i
++) {
20
sum
+=
i
;
21
}
22
23
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
24
25
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
26
// CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-9]+]]
27
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin:
28
// CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID:[0-9]+]]
29
30
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_reduction_begin:
31
// CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]],
32
// CHECK-SAME: codeptr_ra=
33
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_reduction_end:
34
// CHECK-SAME: parallel_id=[[PARALLEL_ID]],
35
// CHECK-SAME: task_id=[[TASK_ID]], codeptr_ra=
36
37
return
0;
38
}
callback.h
main
int main()
Definition:
empty_reduce.c:14
i
#define i
Definition:
kmp_stub.cpp:87
sum
int sum
Definition:
omp_for_schedule_runtime.c:19
Generated on Wed Feb 5 2025 10:57:20 for LLVM OpenMP by
1.9.6