Files
clang-p2996/offload/test/offloading/thread_limit.c
Ethan Luis McDonough 8823448807 [Offload] Refactor offload test requirements (#95196)
Many tests in the `offload` project have requirements defined by which
targets are not supported rather than which platforms are supported.
This patch aims to streamline the requirement definitions by adding four
new feature tags: `host`, `gpu`, `amdgpu`, and `nvidiagpu`.
2024-06-29 00:56:18 -05:00

27 lines
688 B
C

// clang-format off
// RUN: %libomptarget-compile-generic
// RUN: env LIBOMPTARGET_INFO=16 \
// RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefix=DEFAULT
// UNSUPPORTED: nvptx64-nvidia-cuda
// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
// REQUIRES: gpu
int main() {
int n = 1 << 20;
int th = 12;
int te = n / th;
// DEFAULT: 12 (MaxFlatWorkGroupSize:
#pragma omp target
#pragma omp teams loop num_teams(te), thread_limit(th)
for (int i = 0; i < n; i++) {
}
// DEFAULT: 13 (MaxFlatWorkGroupSize:
#pragma omp target
#pragma omp teams distribute parallel for simd num_teams(te), thread_limit(th+1) simdlen(64)
for(int i = 0; i < n; i++) {
}
return 0;
}