Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / ompt / veccopy_emi_map.c
blobfa18a43cd8a50c4f89126d063d1ce09136a8e530
1 // RUN: %libomptarget-compile-run-and-check-generic
2 // REQUIRES: ompt
3 // REQUIRES: gpu
5 /*
6 * Example OpenMP program that shows that map-EMI callbacks are not supported.
7 */
9 #include <assert.h>
10 #include <omp.h>
11 #include <stdio.h>
13 #include "callbacks.h"
14 #include "register_emi_map.h"
16 int main() {
17 int N = 100000;
19 int a[N];
20 int b[N];
22 int i;
24 for (i = 0; i < N; i++)
25 a[i] = 0;
27 for (i = 0; i < N; i++)
28 b[i] = i;
30 #pragma omp target parallel for
32 for (int j = 0; j < N; j++)
33 a[j] = b[j];
36 #pragma omp target teams distribute parallel for
38 for (int j = 0; j < N; j++)
39 a[j] = b[j];
42 int rc = 0;
43 for (i = 0; i < N; i++)
44 if (a[i] != b[i]) {
45 rc++;
46 printf("Wrong value: a[%d]=%d\n", i, a[i]);
49 if (!rc)
50 printf("Success\n");
52 return rc;
55 /// CHECK: 0: Could not register callback 'ompt_callback_target_map_emi'
56 /// CHECK: Callback Init:
57 /// CHECK: Callback Load:
58 /// CHECK: Callback Target EMI: kind=1 endpoint=1
59 /// CHECK: Callback DataOp EMI: endpoint=1 optype=1
60 /// CHECK: Callback DataOp EMI: endpoint=2 optype=1
61 /// CHECK-NOT: dest=(nil)
62 /// CHECK: Callback DataOp EMI: endpoint=1 optype=2
63 /// CHECK: Callback DataOp EMI: endpoint=2 optype=2
64 /// CHECK: Callback DataOp EMI: endpoint=1 optype=1
65 /// CHECK: Callback DataOp EMI: endpoint=2 optype=1
66 /// CHECK-NOT: dest=(nil)
67 /// CHECK: Callback DataOp EMI: endpoint=1 optype=2
68 /// CHECK: Callback DataOp EMI: endpoint=2 optype=2
69 /// CHECK: Callback Submit EMI: endpoint=1 req_num_teams=1
70 /// CHECK: Callback Submit EMI: endpoint=2 req_num_teams=1
71 /// CHECK: Callback DataOp EMI: endpoint=1 optype=3
72 /// CHECK: Callback DataOp EMI: endpoint=2 optype=3
73 /// CHECK: Callback DataOp EMI: endpoint=1 optype=3
74 /// CHECK: Callback DataOp EMI: endpoint=2 optype=3
75 /// CHECK: Callback DataOp EMI: endpoint=1 optype=4
76 /// CHECK: Callback DataOp EMI: endpoint=2 optype=4
77 /// CHECK: Callback DataOp EMI: endpoint=1 optype=4
78 /// CHECK: Callback DataOp EMI: endpoint=2 optype=4
79 /// CHECK: Callback Target EMI: kind=1 endpoint=2
80 /// CHECK: Callback Target EMI: kind=1 endpoint=1
81 /// CHECK: Callback DataOp EMI: endpoint=1 optype=1
82 /// CHECK: Callback DataOp EMI: endpoint=2 optype=1
83 /// CHECK-NOT: dest=(nil)
84 /// CHECK: Callback DataOp EMI: endpoint=1 optype=2
85 /// CHECK: Callback DataOp EMI: endpoint=2 optype=2
86 /// CHECK: Callback DataOp EMI: endpoint=1 optype=1
87 /// CHECK: Callback DataOp EMI: endpoint=2 optype=1
88 /// CHECK-NOT: dest=(nil)
89 /// CHECK: Callback DataOp EMI: endpoint=1 optype=2
90 /// CHECK: Callback DataOp EMI: endpoint=2 optype=2
91 /// CHECK: Callback Submit EMI: endpoint=1 req_num_teams=0
92 /// CHECK: Callback Submit EMI: endpoint=2 req_num_teams=0
93 /// CHECK: Callback DataOp EMI: endpoint=1 optype=3
94 /// CHECK: Callback DataOp EMI: endpoint=2 optype=3
95 /// CHECK: Callback DataOp EMI: endpoint=1 optype=3
96 /// CHECK: Callback DataOp EMI: endpoint=2 optype=3
97 /// CHECK: Callback DataOp EMI: endpoint=1 optype=4
98 /// CHECK: Callback DataOp EMI: endpoint=2 optype=4
99 /// CHECK: Callback DataOp EMI: endpoint=1 optype=4
100 /// CHECK: Callback DataOp EMI: endpoint=2 optype=4
101 /// CHECK: Callback Target EMI: kind=1 endpoint=2
102 /// CHECK: Callback Fini: