[clang] [HIP] Make the HIP default architecture use the enum value (PR #84400)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 15:22:23 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Joseph Huber (jhuber6)

<details>
<summary>Changes</summary>

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


---
Full diff: https://github.com/llvm/llvm-project/pull/84400.diff


2 Files Affected:

- (modified) clang/include/clang/Basic/Cuda.h (+1-1) 
- (modified) clang/lib/Driver/Driver.cpp (+1-1) 


``````````diff
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)) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/84400


More information about the cfe-commits mailing list