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

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 15:21:55 PST 2024


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

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


>From 4f791a35e775842e758e7be60fef6e3669986c7d Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Thu, 7 Mar 2024 17:20:58 -0600
Subject: [PATCH] [HIP] Make the HIP default architecture use the enum value

Summary:
This default enum is used in other places, we should keep it consistent.
---
 clang/include/clang/Basic/Cuda.h | 2 +-
 clang/lib/Driver/Driver.cpp      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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