[clang] c487b84 - [HIP] Change default offload arch to gfx906

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 22 18:22:43 PST 2023


Author: Yaxun (Sam) Liu
Date: 2023-01-22T20:26:30-05:00
New Revision: c487b84d755298b6451a823447612fda84db9522

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

LOG: [HIP] Change default offload arch to gfx906

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D142246

Added: 
    

Modified: 
    clang/lib/Driver/Driver.cpp
    clang/test/Driver/cuda-flush-denormals-to-zero.cu
    clang/test/Driver/hip-default-gpu-arch.hip

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 58e1090673fad..49faa193fb7b1 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3303,7 +3303,7 @@ class OffloadingActionBuilder final {
     HIPActionBuilder(Compilation &C, DerivedArgList &Args,
                      const Driver::InputList &Inputs)
         : CudaActionBuilderBase(C, Args, Inputs, Action::OFK_HIP) {
-      DefaultCudaArch = CudaArch::GFX803;
+      DefaultCudaArch = CudaArch::GFX906;
       if (Args.hasArg(options::OPT_gpu_bundle_output,
                       options::OPT_no_gpu_bundle_output))
         BundleOutput = Args.hasFlag(options::OPT_gpu_bundle_output,

diff  --git a/clang/test/Driver/cuda-flush-denormals-to-zero.cu b/clang/test/Driver/cuda-flush-denormals-to-zero.cu
index c971d15c53560..15525f9c1b814 100644
--- a/clang/test/Driver/cuda-flush-denormals-to-zero.cu
+++ b/clang/test/Driver/cuda-flush-denormals-to-zero.cu
@@ -25,9 +25,10 @@
 // Test the default changing with no argument based on the subtarget in HIP mode
 // RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
 // RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
+// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx906 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
 
-// Test no subtarget, which should get the denormal setting of the default gfx803
-// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=FTZ %s
+// Test no subtarget, which should get the denormal setting of the default gfx906
+// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
 
 // Test multiple offload archs with 
diff erent defaults.
 // RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=MIXED-DEFAULT-MODE %s

diff  --git a/clang/test/Driver/hip-default-gpu-arch.hip b/clang/test/Driver/hip-default-gpu-arch.hip
index 69d98d0f35695..2bb7afecd806f 100644
--- a/clang/test/Driver/hip-default-gpu-arch.hip
+++ b/clang/test/Driver/hip-default-gpu-arch.hip
@@ -3,4 +3,4 @@
 
 // RUN: %clang -### -c %s 2>&1 | FileCheck %s
 
-// CHECK: {{.*}}clang{{.*}}"-target-cpu" "gfx803"
+// CHECK: {{.*}}clang{{.*}}"-target-cpu" "gfx906"


        


More information about the cfe-commits mailing list