Files
clang-p2996/offload/test/offloading/high_trip_count_block_limit.cpp
Jan Patrick Lehr 1a0cf245ac [Offload] Change x86_64-pc-linux to x86_64-unknown-linux (#107023)
It appears that the RUNTIMES build prefers the x86-64-unknown-linux-gnu
triple notation for the host. This fixes runtime / test breakages when
compiler-rt is used as the CLANG_DEFAULT_RTLIB.
2024-09-03 14:25:33 +02:00

36 lines
1.0 KiB
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: aarch64-unknown-linux-gnu-LTO
// UNSUPPORTED: x86_64-unknown-linux-gnu
// UNSUPPORTED: x86_64-unknown-linux-gnu-LTO
// UNSUPPORTED: s390x-ibm-linux-gnu
// UNSUPPORTED: s390x-ibm-linux-gnu-LTO
// 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;
}