[clang] 25629bb - Fix cuda-bad-arch.cu test.

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 13 11:58:33 PDT 2021


Author: Artem Belevich
Date: 2021-07-13T11:57:25-07:00
New Revision: 25629bb45f0a4b8c8e99dbde4f4a7e3d980b9fd7

URL: https://github.com/llvm/llvm-project/commit/25629bb45f0a4b8c8e99dbde4f4a7e3d980b9fd7
DIFF: https://github.com/llvm/llvm-project/commit/25629bb45f0a4b8c8e99dbde4f4a7e3d980b9fd7.diff

LOG: Fix cuda-bad-arch.cu test.

Tests for correctness of HIP architecture need `- xhip`

Added: 
    

Modified: 
    clang/test/Driver/cuda-arch-translation.cu
    clang/test/Driver/cuda-bad-arch.cu
    clang/test/Driver/cuda-flush-denormals-to-zero.cu

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/cuda-arch-translation.cu b/clang/test/Driver/cuda-arch-translation.cu
index b574d082218e..683add533879 100644
--- a/clang/test/Driver/cuda-arch-translation.cu
+++ b/clang/test/Driver/cuda-arch-translation.cu
@@ -6,67 +6,69 @@
 // REQUIRES: nvptx-registered-target
 
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM20 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM20 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_21 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM21 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM21 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_30 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM30 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM30 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_32 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM32 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM32 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_35 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM35 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM35 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_37 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM37 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM37 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_50 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM50 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM50 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_52 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM52 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM52 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_53 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM53 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM53 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_60 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM60 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM60 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_61 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM61 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM61 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_62 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM62 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM62 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_70 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,SM70 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx600 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX600 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx601 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX601 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx602 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX602 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx700 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX700 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx701 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX701 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx702 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX702 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx703 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX703 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx704 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX704 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx705 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX705 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx801 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX801 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx802 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX802 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx803 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX803 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx805 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX805 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx810 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX810 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx900 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX900 %s
-// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx902 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,GFX902 %s
+// RUN: | FileCheck -check-prefixes=CUDA,SM70 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx600 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX600 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx601 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX601 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx602 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX602 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx700 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX700 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx701 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX701 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx702 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX702 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx703 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX703 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx704 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX704 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx705 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX705 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx801 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX801 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx802 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX802 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx803 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX803 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx805 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX805 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx810 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX810 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx900 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX900 %s
+// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx902 %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=HIP,GFX902 %s
 
-// COMMON: ptxas
-// COMMON-SAME: -m64
-// COMMON: fatbinary
+// CUDA: ptxas
+// CUDA-SAME: -m64
+// CUDA: fatbinary
+
+// HIP: clang-offload-bundler
 
 // SM20:--image=profile=sm_20{{.*}}--image=profile=compute_20
 // SM21:--image=profile=sm_21{{.*}}--image=profile=compute_20
@@ -81,19 +83,19 @@
 // SM61:--image=profile=sm_61{{.*}}--image=profile=compute_61
 // SM62:--image=profile=sm_62{{.*}}--image=profile=compute_62
 // SM70:--image=profile=sm_70{{.*}}--image=profile=compute_70
-// GFX600:--image=profile=gfx600{{.*}}--image=profile=compute_amdgcn
-// GFX601:--image=profile=gfx601{{.*}}--image=profile=compute_amdgcn
-// GFX602:--image=profile=gfx602{{.*}}--image=profile=compute_amdgcn
-// GFX700:--image=profile=gfx700{{.*}}--image=profile=compute_amdgcn
-// GFX701:--image=profile=gfx701{{.*}}--image=profile=compute_amdgcn
-// GFX702:--image=profile=gfx702{{.*}}--image=profile=compute_amdgcn
-// GFX703:--image=profile=gfx703{{.*}}--image=profile=compute_amdgcn
-// GFX704:--image=profile=gfx704{{.*}}--image=profile=compute_amdgcn
-// GFX705:--image=profile=gfx705{{.*}}--image=profile=compute_amdgcn
-// GFX801:--image=profile=gfx801{{.*}}--image=profile=compute_amdgcn
-// GFX802:--image=profile=gfx802{{.*}}--image=profile=compute_amdgcn
-// GFX803:--image=profile=gfx803{{.*}}--image=profile=compute_amdgcn
-// GFX805:--image=profile=gfx805{{.*}}--image=profile=compute_amdgcn
-// GFX810:--image=profile=gfx810{{.*}}--image=profile=compute_amdgcn
-// GFX900:--image=profile=gfx900{{.*}}--image=profile=compute_amdgcn
-// GFX902:--image=profile=gfx902{{.*}}--image=profile=compute_amdgcn
+// GFX600:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx600
+// GFX601:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx601
+// GFX602:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx602
+// GFX700:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx700
+// GFX701:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx701
+// GFX702:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx702
+// GFX703:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx703
+// GFX704:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx704
+// GFX705:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx705
+// GFX801:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx801
+// GFX802:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx802
+// GFX803:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx803
+// GFX805:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx805
+// GFX810:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx810
+// GFX900:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx900
+// GFX902:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx902

diff  --git a/clang/test/Driver/cuda-bad-arch.cu b/clang/test/Driver/cuda-bad-arch.cu
index b60a04162b2e..8f52f6e4b6c1 100644
--- a/clang/test/Driver/cuda-bad-arch.cu
+++ b/clang/test/Driver/cuda-bad-arch.cu
@@ -25,9 +25,9 @@
 // RUN: | FileCheck -check-prefix OK %s
 // RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_52 -c %s 2>&1 \
 // RUN: | FileCheck -check-prefix OK %s
-// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=gfx908 -c %s 2>&1 \
+// RUN: %clang -### -x hip -target x86_64-linux-gnu --cuda-gpu-arch=gfx908 -c %s 2>&1 \
 // RUN: | FileCheck -check-prefix OK %s
-// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=gfx90a -c %s 2>&1 \
+// RUN: %clang -### -x hip -target x86_64-linux-gnu --cuda-gpu-arch=gfx90a -c %s 2>&1 \
 // RUN: | FileCheck -check-prefix OK %s
 // RUN: %clang -### -target x86_64-linux-gnu -c %s 2>&1 \
 // RUN: | FileCheck -check-prefix OK %s

diff  --git a/clang/test/Driver/cuda-flush-denormals-to-zero.cu b/clang/test/Driver/cuda-flush-denormals-to-zero.cu
index e8ac6d73c8ff..0f2b5de431fa 100644
--- a/clang/test/Driver/cuda-flush-denormals-to-zero.cu
+++ b/clang/test/Driver/cuda-flush-denormals-to-zero.cu
@@ -12,8 +12,8 @@
 // RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=sm_20 -fno-cuda-flush-denormals-to-zero -nocudainc -nocudalib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
 
 // Test explicit argument, with CUDA offload kind
-// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
-// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
+// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
+// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
 
 // Test explicit argument, with HIP offload kind
 // RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s


        


More information about the cfe-commits mailing list