llvm-project/offload/test/offloading/high_trip_count_block_limit.cpp
Joseph Huber c722ef4874
[OpenMP] Remove testing LTO variant on CPU targets (#175187)
Summary:
This is only really meaningful for the NVPTX target. Not all build
environments support host LTO and these are redundant tests, just clean
this up and make it run faster.
2026-01-09 10:13:44 -06:00

34 lines
924 B
C++

// clang-format off
// RUN: %libomptarget-compilexx-generic && env LIBOMPTARGET_REUSE_BLOCKS_FOR_HIGH_TRIP_COUNT=False %libomptarget-run-generic 2>&1 | %fcheck-generic
// RUN: %libomptarget-compilexx-generic && %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefix=DEFAULT
// UNSUPPORTED: aarch64-unknown-linux-gnu
// UNSUPPORTED: x86_64-unknown-linux-gnu
// UNSUPPORTED: s390x-ibm-linux-gnu
// XFAIL: intelgpu
// clang-format on
/*
Check if there is a thread for each loop iteration
*/
#include <omp.h>
#include <stdio.h>
int main() {
int N = 819200;
int num_threads[N];
#pragma omp target teams distribute parallel for
for (int j = 0; j < N; j++) {
num_threads[j] = omp_get_num_threads() * omp_get_num_teams();
}
if (num_threads[0] == N)
// CHECK: PASS
printf("PASS\n");
else
// DEFAULT: FAIL
printf("FAIL: num_threads: %d\n != N: %d", num_threads[0], N);
return 0;
}