[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / openmp / libomptarget / test / ompt / veccopy_emi_map.c
blob1be7ae4766e76deca7ebe96d274df781830ac376
1 // RUN: %libomptarget-compile-run-and-check-generic
2 // REQUIRES: ompt
3 // UNSUPPORTED: aarch64-unknown-linux-gnu
4 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
6 /*
7 * Example OpenMP program that shows that map-EMI callbacks are not supported.
8 */
10 #include <assert.h>
11 #include <omp.h>
12 #include <stdio.h>
14 #include "callbacks.h"
15 #include "register_emi_map.h"
17 int main() {
18 int N = 100000;
20 int a[N];
21 int b[N];
23 int i;
25 for (i = 0; i < N; i++)
26 a[i] = 0;
28 for (i = 0; i < N; i++)
29 b[i] = i;
31 #pragma omp target parallel for
33 for (int j = 0; j < N; j++)
34 a[j] = b[j];
37 #pragma omp target teams distribute parallel for
39 for (int j = 0; j < N; j++)
40 a[j] = b[j];
43 int rc = 0;
44 for (i = 0; i < N; i++)
45 if (a[i] != b[i]) {
46 rc++;
47 printf("Wrong value: a[%d]=%d\n", i, a[i]);
50 if (!rc)
51 printf("Success\n");
53 return rc;
56 /// CHECK: 0: Could not register callback 'ompt_callback_target_map_emi'
57 /// CHECK: Callback Init:
58 /// CHECK: Callback Load:
59 /// CHECK: Callback Target EMI: kind=1 endpoint=1
60 /// CHECK: Callback DataOp EMI: endpoint=1 optype=1
61 /// CHECK: Callback DataOp EMI: endpoint=2 optype=1
62 /// CHECK-NOT: dest=(nil)
63 /// CHECK: Callback DataOp EMI: endpoint=1 optype=2
64 /// CHECK: Callback DataOp EMI: endpoint=2 optype=2
65 /// CHECK: Callback DataOp EMI: endpoint=1 optype=1
66 /// CHECK: Callback DataOp EMI: endpoint=2 optype=1
67 /// CHECK-NOT: dest=(nil)
68 /// CHECK: Callback DataOp EMI: endpoint=1 optype=2
69 /// CHECK: Callback DataOp EMI: endpoint=2 optype=2
70 /// CHECK: Callback Submit EMI: endpoint=1 req_num_teams=1
71 /// CHECK: Callback Submit EMI: endpoint=2 req_num_teams=1
72 /// CHECK: Callback DataOp EMI: endpoint=1 optype=3
73 /// CHECK: Callback DataOp EMI: endpoint=2 optype=3
74 /// CHECK: Callback DataOp EMI: endpoint=1 optype=3
75 /// CHECK: Callback DataOp EMI: endpoint=2 optype=3
76 /// CHECK: Callback DataOp EMI: endpoint=1 optype=4
77 /// CHECK: Callback DataOp EMI: endpoint=2 optype=4
78 /// CHECK: Callback DataOp EMI: endpoint=1 optype=4
79 /// CHECK: Callback DataOp EMI: endpoint=2 optype=4
80 /// CHECK: Callback Target EMI: kind=1 endpoint=2
81 /// CHECK: Callback Target EMI: kind=1 endpoint=1
82 /// CHECK: Callback DataOp EMI: endpoint=1 optype=1
83 /// CHECK: Callback DataOp EMI: endpoint=2 optype=1
84 /// CHECK-NOT: dest=(nil)
85 /// CHECK: Callback DataOp EMI: endpoint=1 optype=2
86 /// CHECK: Callback DataOp EMI: endpoint=2 optype=2
87 /// CHECK: Callback DataOp EMI: endpoint=1 optype=1
88 /// CHECK: Callback DataOp EMI: endpoint=2 optype=1
89 /// CHECK-NOT: dest=(nil)
90 /// CHECK: Callback DataOp EMI: endpoint=1 optype=2
91 /// CHECK: Callback DataOp EMI: endpoint=2 optype=2
92 /// CHECK: Callback Submit EMI: endpoint=1 req_num_teams=0
93 /// CHECK: Callback Submit EMI: endpoint=2 req_num_teams=0
94 /// CHECK: Callback DataOp EMI: endpoint=1 optype=3
95 /// CHECK: Callback DataOp EMI: endpoint=2 optype=3
96 /// CHECK: Callback DataOp EMI: endpoint=1 optype=3
97 /// CHECK: Callback DataOp EMI: endpoint=2 optype=3
98 /// CHECK: Callback DataOp EMI: endpoint=1 optype=4
99 /// CHECK: Callback DataOp EMI: endpoint=2 optype=4
100 /// CHECK: Callback DataOp EMI: endpoint=1 optype=4
101 /// CHECK: Callback DataOp EMI: endpoint=2 optype=4
102 /// CHECK: Callback Target EMI: kind=1 endpoint=2
103 /// CHECK: Callback Fini: