llvm-project/offload/test/offloading/high_trip_count_block_limit.cpp
Nick Sarnie 78ff5b55fd
[offload][lit] Enable/disable tests on Level Zero when using DeviceRTL (#182128)
Since we can now build the DeviceRTL with SPIR-V, redo the
`XFAIL/UNSUPPORTED` specifications for the tests we see passing/failing
on the Level Zero backend with the DeviceRTL being used.

The tests marked `UNSUPPORTED` hang or sporadically fail and those are
tracked in https://github.com/llvm/llvm-project/issues/182119.

This change will allow us to enable CI testing with the DeviceRTL.

Here are the full test results with this change applied, running only
the `spirv64-intel` `check-offload` tests:

```
Total Discovered Tests: 453
  Unsupported      : 206 (45.47%)
  Passed           : 141 (31.13%)
  Expectedly Failed: 106 (23.40%)
```

31% is not a bad start.

---------

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2026-02-18 21:53:19 +00:00

35 lines
981 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
// https://github.com/llvm/llvm-project/issues/182119
// UNSUPPORTED: 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;
}