Skip to content

Commit 63b27be

Browse files
EthanLuisMcDonoughcpiaseque
authored andcommitted
[Offload] Refactor offload test requirements (llvm#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`.
1 parent 43ac247 commit 63b27be

File tree

93 files changed

+114
-583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+114
-583
lines changed

offload/test/api/omp_dynamic_shared_memory.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
// RUN: env LIBOMPTARGET_SHARED_MEMORY_SIZE=256 \
77
// RUN: %libomptarget-run-generic | %fcheck-generic
88

9-
// UNSUPPORTED: x86_64-pc-linux-gnu
10-
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
11-
// UNSUPPORTED: aarch64-unknown-linux-gnu
12-
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
13-
// UNSUPPORTED: s390x-ibm-linux-gnu
14-
// UNSUPPORTED: s390x-ibm-linux-gnu-LTO
9+
// REQUIRES: gpu
1510

1611
#include <omp.h>
1712
#include <stdio.h>

offload/test/jit/empty_kernel_lvl1.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828
// RUN: %fcheck-plain-generic --input-file %t.pre.ll %S/empty_kernel.inc --check-prefixes=FIRST,SECOND
2929
// clang-format on
3030

31-
// UNSUPPORTED: aarch64-unknown-linux-gnu
32-
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
33-
// UNSUPPORTED: x86_64-pc-linux-gnu
34-
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
35-
// UNSUPPORTED: s390x-ibm-linux-gnu
36-
// UNSUPPORTED: s390x-ibm-linux-gnu-LTO
31+
// REQUIRES: gpu
3732

3833
#include "empty_kernel.inc"

offload/test/jit/empty_kernel_lvl2.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@
8888
// RUN: not %fcheck-plain-generic --input-file %t.pre.ll %S/empty_kernel.inc --check-prefixes=FIRST,SECOND
8989
// clang-format on
9090

91-
// UNSUPPORTED: aarch64-unknown-linux-gnu
92-
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
93-
// UNSUPPORTED: x86_64-pc-linux-gnu
94-
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
95-
// UNSUPPORTED: s390x-ibm-linux-gnu
96-
// UNSUPPORTED: s390x-ibm-linux-gnu-LTO
91+
// REQUIRES: gpu
9792

9893
#include "empty_kernel.inc"

offload/test/jit/type_punning.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@
88
//
99
// clang-format on
1010

11-
// UNSUPPORTED: aarch64-unknown-linux-gnu
12-
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
13-
// UNSUPPORTED: x86_64-pc-linux-gnu
14-
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
15-
// UNSUPPORTED: s390x-ibm-linux-gnu
16-
// UNSUPPORTED: s390x-ibm-linux-gnu-LTO
11+
// REQUIRES: gpu
1712

1813
// Ensure that there is only the kernel function left, not any outlined
1914
// parallel regions.

offload/test/libc/assert.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55

66
// NVPTX without LTO uses the implementation in OpenMP currently.
77
// UNSUPPORTED: nvptx64-nvidia-cuda
8-
// UNSUPPORTED: powerpc64-ibm-linux-gnu
9-
// UNSUPPORTED: powerpc64-ibm-linux-gnu-LTO
10-
// UNSUPPORTED: aarch64-unknown-linux-gnu
11-
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
12-
// UNSUPPORTED: x86_64-pc-linux-gnu
13-
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
8+
// REQUIRES: gpu
149

1510
#include <assert.h>
1611

offload/test/lit.cfg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,24 @@ def add_libraries(source):
188188
config.llvm_library_intdir + "/libomptarget.devicertl.a"
189189
return source + " " + config.llvm_library_intdir + "/libomptarget.devicertl.a"
190190

191+
# Add platform targets
192+
host_targets = [
193+
"aarch64-unknown-linux-gnu",
194+
"aarch64-unknown-linux-gnu-LTO",
195+
"x86_64-pc-linux-gnu",
196+
"x86_64-pc-linux-gnu-LTO",
197+
"s390x-ibm-linux-gnu",
198+
"s390x-ibm-linux-gnu-LTO",
199+
]
200+
if config.libomptarget_current_target.startswith('nvptx'):
201+
config.available_features.add('gpu')
202+
config.available_features.add('nvidiagpu')
203+
if config.libomptarget_current_target.startswith('amdgcn'):
204+
config.available_features.add('gpu')
205+
config.available_features.add('amdgpu')
206+
if config.libomptarget_current_target in host_targets:
207+
config.available_features.add('host')
208+
191209
# substitutions
192210
# - for targets that exist in the system create the actual command.
193211
# - for valid targets that do not exist in the system, return false, so that the

offload/test/mapping/auto_zero_copy.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@
77
// RUN: env HSA_XNACK=0 LIBOMPTARGET_INFO=30 %libomptarget-run-generic 2>&1 \
88
// RUN: | %fcheck-generic -check-prefix=INFO_COPY -check-prefix=CHECK
99

10-
// UNSUPPORTED: aarch64-unknown-linux-gnu
11-
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
12-
// UNSUPPORTED: nvptx64-nvidia-cuda
13-
// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
14-
// UNSUPPORTED: x86_64-pc-linux-gnu
15-
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
16-
// UNSUPPORTED: s390x-ibm-linux-gnu
17-
// UNSUPPORTED: s390x-ibm-linux-gnu-LTO
18-
10+
// REQUIRES: amdgpu
1911
// REQUIRES: unified_shared_memory
2012

2113
// clang-format on

offload/test/mapping/auto_zero_copy_apu.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77
// RUN: env HSA_XNACK=0 LIBOMPTARGET_INFO=30 %libomptarget-run-generic 2>&1 \
88
// RUN: | %fcheck-generic -check-prefix=INFO_COPY -check-prefix=CHECK
99

10-
// UNSUPPORTED: aarch64-unknown-linux-gnu
11-
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
12-
// UNSUPPORTED: nvptx64-nvidia-cuda
13-
// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
14-
// UNSUPPORTED: x86_64-pc-linux-gnu
15-
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
16-
10+
// REQUIRES: amdgpu
1711
// REQUIRES: apu
1812

1913
// clang-format on

offload/test/mapping/auto_zero_copy_globals.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@
33
// RUN: env OMPX_APU_MAPS=1 HSA_XNACK=1 LIBOMPTARGET_INFO=60 %libomptarget-run-generic 2>&1 \
44
// RUN: | %fcheck-generic -check-prefix=CHECK
55

6-
// UNSUPPORTED: aarch64-unknown-linux-gnu
7-
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
8-
// UNSUPPORTED: nvptx64-nvidia-cuda
9-
// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
10-
// UNSUPPORTED: x86_64-pc-linux-gnu
11-
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
12-
// UNSUPPORTED: s390x-ibm-linux-gnu
13-
// UNSUPPORTED: s390x-ibm-linux-gnu-LTO
14-
6+
// REQUIRES: amdgpu
157
// REQUIRES: unified_shared_memory
168

179
// clang-format on

offload/test/mapping/prelock.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
// RUN: %libomptarget-compilexx-generic
22
// RUN: %libomptarget-run-generic %fcheck-generic
33

4-
// UNSUPPORTED: aarch64-unknown-linux-gnu
5-
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
6-
// UNSUPPORTED: nvptx64-nvidia-cuda
7-
// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
8-
// UNSUPPORTED: x86_64-pc-linux-gnu
9-
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
10-
// UNSUPPORTED: amdgcn-amd-amdhsa
4+
// REQURIES: gpu
5+
// UNSUPPORTED: nvidiagpu
6+
// UNSUPPORTED: amdgpu
117

128
#include <cstdio>
139

0 commit comments

Comments
 (0)