// clang-format off // This test verifies that Xteam reduction kernel is generated by default and the // thread_limit clause is honored. The blocksize is rounded down to the nearest // power of 2. // // RUN: %libomptarget-compile-generic // RUN: env LIBOMPTARGET_KERNEL_TRACE=1 %libomptarget-run-generic 2>&1 | %fcheck-generic // UNSUPPORTED: nvptx64-nvidia-cuda // UNSUPPORTED: nvptx64-nvidia-cuda-LTO // UNSUPPORTED: aarch64-unknown-linux-gnu // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO // UNSUPPORTED: x86_64-unknown-linux-gnu // UNSUPPORTED: x86_64-unknown-linux-gnu-LTO // clang-format on #include int main() { int N = 100; double a[N]; for (int i = 0; i < N; i++) a[i] = i; double sum1; sum1 = 0; #pragma omp target teams distribute parallel for reduction(+ : sum1) thread_limit(130) for (int j = 0; j < N; j = j + 1) sum1 += a[j]; int rc = sum1 != 4950; return rc; } // clang-format off /// CHECK: DEVID:[[S:[ ]*]][[DEVID:[0-9]+]] SGN:8 /// CHECK: teamsXthrds:([[S:[ ]*]][[NUM_TEAMS:[0-9]+]]X 128)