[flang-commits] [flang] [flang][cuda] Do inline allocation/deallocation in device code (PR #106628)

via flang-commits flang-commits at lists.llvm.org
Thu Aug 29 14:14:16 PDT 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 0a41c8e7a050c837c609cbcbc8342024701cd14b 6ac6f512d3915d108b819ec06e9367a3b6c78bc9 --extensions cpp,h -- flang/include/flang/Lower/Cuda.h flang/lib/Lower/Allocatable.cpp flang/lib/Lower/Bridge.cpp
``````````

</details>

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

``````````diff
diff --git a/flang/include/flang/Lower/Cuda.h b/flang/include/flang/Lower/Cuda.h
index 138d3119bf..e446b505ee 100644
--- a/flang/include/flang/Lower/Cuda.h
+++ b/flang/include/flang/Lower/Cuda.h
@@ -31,18 +31,16 @@ static bool isCudaDeviceContext(fir::FirOpBuilder &builder) {
   if (builder.getRegion()
           .getParentOfType<mlir::acc::ComputeRegionOpInterface>())
     return true;
-  if (auto funcOp =
-          builder.getRegion().getParentOfType<mlir::func::FuncOp>()) {
+  if (auto funcOp = builder.getRegion().getParentOfType<mlir::func::FuncOp>()) {
     if (auto cudaProcAttr =
             funcOp.getOperation()->getAttrOfType<cuf::ProcAttributeAttr>(
                 cuf::getProcAttrName())) {
       return cudaProcAttr.getValue() != cuf::ProcAttribute::Host &&
-              cudaProcAttr.getValue() != cuf::ProcAttribute::HostDevice;
+             cudaProcAttr.getValue() != cuf::ProcAttribute::HostDevice;
     }
   }
   return false;
 }
 } // end namespace Fortran::lower
 
-
 #endif // FORTRAN_LOWER_CUDA_H

``````````

</details>


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


More information about the flang-commits mailing list