[clang] 4d1d127 - [HIP] Make the HIP default architecture use the enum value (#84400)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 04:54:55 PST 2024


Author: Joseph Huber
Date: 2024-03-08T06:54:52-06:00
New Revision: 4d1d1271b8612c72e0020c9d9f42d2ef70f717e7

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

LOG: [HIP] Make the HIP default architecture use the enum value (#84400)

Summary:
This default enum is used in other places, we should keep it consistent.

Added: 
    

Modified: 
    clang/include/clang/Basic/Cuda.h
    clang/lib/Driver/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h
index 916cb4b7ef34a7..3e77a74c7c0092 100644
--- a/clang/include/clang/Basic/Cuda.h
+++ b/clang/include/clang/Basic/Cuda.h
@@ -123,7 +123,7 @@ enum class CudaArch {
   LAST,
 
   CudaDefault = CudaArch::SM_52,
-  HIPDefault = CudaArch::GFX803,
+  HIPDefault = CudaArch::GFX906,
 };
 
 static inline bool IsNVIDIAGpuArch(CudaArch A) {

diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 96e6ad77f5e50d..fce43430a91374 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3373,7 +3373,7 @@ class OffloadingActionBuilder final {
                      const Driver::InputList &Inputs)
         : CudaActionBuilderBase(C, Args, Inputs, Action::OFK_HIP) {
 
-      DefaultCudaArch = CudaArch::GFX906;
+      DefaultCudaArch = CudaArch::HIPDefault;
 
       if (Args.hasArg(options::OPT_fhip_emit_relocatable,
                       options::OPT_fno_hip_emit_relocatable)) {


        


More information about the cfe-commits mailing list