[clang] [HIP][Driver] Automatically include `hipstdpar` forwarding header (PR #78915)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 21 14:00:42 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 5518a9d7673bfe55b4110bea049140316d032fbf 37453ff13fd7a61f2072069cf94615497c748089 -- clang/lib/Driver/ToolChains/AMDGPU.cpp clang/test/Driver/hipstdpar.c
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Driver/ToolChains/AMDGPU.cpp b/clang/lib/Driver/ToolChains/AMDGPU.cpp
index 8a88dba562..b3c9d59086 100644
--- a/clang/lib/Driver/ToolChains/AMDGPU.cpp
+++ b/clang/lib/Driver/ToolChains/AMDGPU.cpp
@@ -551,9 +551,9 @@ void RocmInstallationDetector::AddHIPIncludeArgs(const ArgList &DriverArgs,
     if (!hasHIPStdParLibrary())
       if (!HIPStdParPathArg.empty() ||
           !FS.exists(Inc + "/thrust/system/hip/hipstdpar/hipstdpar_lib.hpp")) {
-      D.Diag(diag::err_drv_no_hipstdpar_lib);
-      return;
-    }
+        D.Diag(diag::err_drv_no_hipstdpar_lib);
+        return;
+      }
     if (!HasRocThrustLibrary && !FS.exists(Inc + "/thrust")) {
       D.Diag(diag::err_drv_no_hipstdpar_thrust_lib);
       return;
@@ -582,8 +582,8 @@ void RocmInstallationDetector::AddHIPIncludeArgs(const ArgList &DriverArgs,
       PrimPath = DriverArgs.MakeArgString(getIncludePath() + "/rocprim");
 
     CC1Args.append({"-idirafter", ThrustPath, "-idirafter", PrimPath,
-                    "-idirafter", HIPStdParPath,
-                    "-include", "hipstdpar_lib.hpp"});
+                    "-idirafter", HIPStdParPath, "-include",
+                    "hipstdpar_lib.hpp"});
   };
 
   if (DriverArgs.hasArg(options::OPT_nogpuinc)) {

``````````

</details>


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


More information about the cfe-commits mailing list