Files
clang-p2996/openmp/libomptarget/test/offloading/small_trip_count.c
Ulrich Weigand c9062e8f78 Reapply [libomptarget] Build plugins-nextgen for SystemZ (#83978)
The plugin was not getting built as the build_generic_elf64 macro
assumes the LLVM triple processor name matches the CMake processor name,
which is unfortunately not the case for SystemZ.

Fix this by providing two separate arguments instead.

Actually building the plugin exposed a number of other issues causing
various test failures. Specifically, I've had to add the SystemZ target
to
- CompilerInvocation::ParseLangArgs
- linkDevice in ClangLinuxWrapper.cpp
- OMPContext::OMPContext (to set the device_kind_cpu trait)
- LIBOMPTARGET_ALL_TARGETS in libomptarget/CMakeLists.txt
- a check_plugin_target call in libomptarget/src/CMakeLists.txt

Finally, I've had to set a number of test cases to UNSUPPORTED on
s390x-ibm-linux-gnu; all these tests were already marked as UNSUPPORTED
for x86_64-pc-linux-gnu and aarch64-unknown-linux-gnu and are failing on
s390x for what seem to be the same reason.

In addition, this also requires support for BE ELF files in
plugins-nextgen: https://github.com/llvm/llvm-project/pull/85246
2024-03-15 19:06:43 +01:00

46 lines
1.8 KiB
C

// clang-format off
// RUN: %libomptarget-compile-generic
// RUN: env LIBOMPTARGET_INFO=16 \
// RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefix=DEFAULT
// RUN: env LIBOMPTARGET_INFO=16 LIBOMPTARGET_MIN_THREADS_FOR_LOW_TRIP_COUNT=8 \
// RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefix=EIGHT
// UNSUPPORTED: aarch64-unknown-linux-gnu
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
// UNSUPPORTED: x86_64-pc-linux-gnu
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
// UNSUPPORTED: s390x-ibm-linux-gnu
// UNSUPPORTED: s390x-ibm-linux-gnu-LTO
#define N 128
__attribute__((optnone)) void optnone() {}
int main() {
// DEFAULT: Launching kernel {{.+_main_.+}} with 4 blocks and 32 threads in SPMD mode
// EIGHT: Launching kernel {{.+_main_.+}} with 16 blocks and 8 threads in SPMD mode
#pragma omp target teams distribute parallel for simd
for (int i = 0; i < N; ++i) {
optnone();
}
// DEFAULT: Launching kernel {{.+_main_.+}} with 4 blocks and 32 threads in SPMD mode
// EIGHT: Launching kernel {{.+_main_.+}} with 16 blocks and 8 threads in SPMD mode
#pragma omp target teams distribute parallel for simd
for (int i = 0; i < N - 1; ++i) {
optnone();
}
// DEFAULT: Launching kernel {{.+_main_.+}} with 5 blocks and 32 threads in SPMD mode
// EIGHT: Launching kernel {{.+_main_.+}} with 17 blocks and 8 threads in SPMD mode
#pragma omp target teams distribute parallel for simd
for (int i = 0; i < N + 1; ++i) {
optnone();
}
// DEFAULT: Launching kernel {{.+_main_.+}} with 32 blocks and 4 threads in SPMD mode
// EIGHT: Launching kernel {{.+_main_.+}} with 32 blocks and 4 threads in SPMD mode
#pragma omp target teams distribute parallel for simd thread_limit(4)
for (int i = 0; i < N; ++i) {
optnone();
}
}