Skip to content

Commit df577cc

Browse files
committed
Update AMDGCN and NVPTX tests
1 parent 25785a2 commit df577cc

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed
Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
// REQUIRES: amdgpu-registered-target
2-
31
// Check device traits macros are defined if sycl is enabled:
4-
// RUN: %clangxx -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 -### %s 2>&1 \
5-
// RUN: | FileCheck -check-prefix=CHECK-SYCL-AMDGCN-AMD-AMDHSA %s
6-
// CHECK-SYCL-AMDGCN-AMD-AMDHSA-NOT: "-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1"
7-
// CHECK-SYCL-AMDGCN-AMD-AMDHSA: "-D__SYCL_ANY_DEVICE_HAS_{{.*}}__=1"
8-
// CHECK-SYCL-AMDGCN-AMD-AMDHSA: "{{(-D__SYCL_ALL_DEVICES_HAVE_)?}}{{.*}}{{(__=1)?}}"
2+
// Compiling for a specific HIP target passing the device to '-fsycl-targets'.
3+
// RUN: %clangxx -nogpulib -fsycl -fsycl-targets=amd_gpu_gfx906 \
4+
// RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/libspirv.bc -### %s 2>&1 \
5+
// RUN: | FileCheck -check-prefix=CHECK-SYCL-AMDGCN-AMD-AMDHSA-DEVICE-TRIPLE %s
6+
// CHECK-SYCL-AMDGCN-AMD-AMDHSA-DEVICE-TRIPLE-NOT: "-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1"
7+
// CHECK-SYCL-AMDGCN-AMD-AMDHSA-DEVICE-TRIPLE: "-D__SYCL_ANY_DEVICE_HAS_{{.*}}__=1"
8+
// CHECK-SYCL-AMDGCN-AMD-AMDHSA-DEVICE-TRIPLE: "{{(-D__SYCL_ALL_DEVICES_HAVE_)?}}{{.*}}{{(__=1)?}}"
99

10+
// Check device traits macros are defined if sycl is enabled:
11+
// Compiling for a HIP target passing the device arch to '--offload-arch'.
12+
// RUN: %clangxx -nogpulib -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 \
13+
// RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/libspirv.bc -### %s 2>&1 \
14+
// RUN: | FileCheck -check-prefix=CHECK-SYCL-AMDGCN-AMD-AMDHSA-OFFLOAD-ARCH %s
15+
// CHECK-SYCL-AMDGCN-AMD-AMDHSA-OFFLOAD-ARCH-NOT: "-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1"
16+
// CHECK-SYCL-AMDGCN-AMD-AMDHSA-OFFLOAD-ARCH: "-D__SYCL_ANY_DEVICE_HAS_{{.*}}__=1"
17+
// CHECK-SYCL-AMDGCN-AMD-AMDHSA-OFFLOAD-ARCH: "{{(-D__SYCL_ALL_DEVICES_HAVE_)?}}{{.*}}{{(__=1)?}}"
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
// REQUIRES: nvptx-registered-target
1+
// Check device traits macros are defined if sycl is enabled:
2+
// Compiling for the default CUDA target passing the triple to '-fsycl-targets'.
3+
// RUN: %clangxx -nocudalib -fsycl -fsycl-targets=nvptx64-nvidia-cuda -### %s 2>&1 \
4+
// RUN: | FileCheck -check-prefix=CHECK-SYCL-NVPTX-NVIDIA-CUDA-DEFAULT-TRIPLE %s
5+
// CHECK-SYCL-NVPTX-NVIDIA-CUDA-DEFAULT-TRIPLE-COUNT-2: "-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1"
6+
// CHECK-SYCL-NVPTX-NVIDIA-CUDA-DEFAULT-TRIPLE: "{{(-D__SYCL_ALL_DEVICES_HAVE_)?}}{{.*}}{{(__=1)?}}"
27

38
// Check device traits macros are defined if sycl is enabled:
4-
// RUN: %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda -### %s 2>&1 \
5-
// RUN: | FileCheck -check-prefix=CHECK-SYCL-NVPTX-NVIDIA-CUDA %s
6-
// CHECK-SYCL-NVPTX-NVIDIA-CUDA-COUNT-2: "-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1"
7-
// CHECK-SYCL-NVPTX-NVIDIA-CUDA: "-D__SYCL_ANY_DEVICE_HAS_{{.*}}__=1"
8-
// CHECK-SYCL-NVPTX-NVIDIA-CUDA: "{{(-D__SYCL_ALL_DEVICES_HAVE_)?}}{{.*}}{{(__=1)?}}"
9+
// Compiling for a specific CUDA target passing the device to '-fsycl-targets'.
10+
// RUN: %clangxx -nocudalib -fsycl -fsycl-targets=nvidia_gpu_sm_80 -### %s 2>&1 \
11+
// RUN: | FileCheck -check-prefix=CHECK-SYCL-NVPTX-NVIDIA-CUDA-DEVICE-TRIPLE %s
12+
// CHECK-SYCL-NVPTX-NVIDIA-CUDA-DEVICE-TRIPLE-COUNT-2: "-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1"
13+
// CHECK-SYCL-NVPTX-NVIDIA-CUDA-DEVICE-TRIPLE: "{{(-D__SYCL_ALL_DEVICES_HAVE_)?}}{{.*}}{{(__=1)?}}"
914

15+
// Check device traits macros are defined if sycl is enabled:
16+
// Compiling for a CUDA target passing the device arch to '--offload-arch'.
17+
// RUN: %clangxx -nocudalib -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --offload-arch=sm_80 -### %s 2>&1 \
18+
// RUN: | FileCheck -check-prefix=CHECK-SYCL-NVPTX-NVIDIA-CUDA-OFFLOAD-ARCH %s
19+
// CHECK-SYCL-NVPTX-NVIDIA-CUDA-OFFLOAD-ARCH-COUNT-2: "-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1"
20+
// CHECK-SYCL-NVPTX-NVIDIA-CUDA-OFFLOAD-ARCH: "{{(-D__SYCL_ALL_DEVICES_HAVE_)?}}{{.*}}{{(__=1)?}}"

0 commit comments

Comments
 (0)