[RISCV][VLOPT] Add vector narrowing integer right shift instructions to isSupportedIn...
[llvm-project.git] / offload / test / offloading / parallel_target_teams_reduction.cpp
blobd6486f623778367ed21d92048f42a6b210d4b461
1 // RUN: %libomptarget-compilexx-run-and-check-generic
2 // RUN: %libomptarget-compileoptxx-run-and-check-generic
4 // FIXME: This is a bug in host offload, this should run fine.
5 // REQUIRES: gpu
7 #include <iostream>
8 #include <vector>
10 #define N 8
12 int main() {
13 std::vector<int> avec(N);
14 int *a = avec.data();
15 #pragma omp parallel for
16 for (int i = 0; i < N; i++) {
17 a[i] = 0;
18 #pragma omp target teams distribute parallel for reduction(+ : a[i])
19 for (int j = 0; j < N; j++)
20 a[i] += 1;
23 // CHECK: 8
24 // CHECK: 8
25 // CHECK: 8
26 // CHECK: 8
27 // CHECK: 8
28 // CHECK: 8
29 // CHECK: 8
30 // CHECK: 8
31 for (int i = 0; i < N; i++)
32 std::cout << a[i] << std::endl;