[flang] [llvm] [flang][cuda] Pass allocator index to allocate functions (PR #157189)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 5 15:14:10 PDT 2025


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 origin/main HEAD --extensions h,cpp -- flang-rt/lib/cuda/allocatable.cpp flang-rt/lib/cuda/pointer.cpp flang/include/flang/Lower/CUDA.h flang/include/flang/Optimizer/Dialect/CUF/Attributes/CUFAttr.h flang/include/flang/Runtime/CUDA/allocatable.h flang/include/flang/Runtime/CUDA/pointer.h flang/lib/Lower/CUDA.cpp flang/lib/Lower/ConvertVariable.cpp flang/lib/Optimizer/Dialect/CUF/Attributes/CUFAttr.cpp flang/lib/Optimizer/Transforms/CUFOpConversion.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/flang-rt/lib/cuda/allocatable.cpp b/flang-rt/lib/cuda/allocatable.cpp
index 483b54061..4862d7feb 100644
--- a/flang-rt/lib/cuda/allocatable.cpp
+++ b/flang-rt/lib/cuda/allocatable.cpp
@@ -59,8 +59,9 @@ int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, int32_t allocIdx,
 }
 
 int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
-    const Descriptor &source, int32_t allocIdx, int64_t *stream, bool *pinned, bool hasStat,
-    const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
+    const Descriptor &source, int32_t allocIdx, int64_t *stream, bool *pinned,
+    bool hasStat, const Descriptor *errMsg, const char *sourceFile,
+    int sourceLine) {
   int stat{RTNAME(CUFAllocatableAllocate)(alloc, allocIdx, stream, pinned,
       hasStat, errMsg, sourceFile, sourceLine)};
   if (stat == StatOk) {
@@ -72,8 +73,9 @@ int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
 }
 
 int RTDEF(CUFAllocatableAllocateSourceSync)(Descriptor &alloc,
-    const Descriptor &source, int32_t allocIdx, int64_t *stream, bool *pinned, bool hasStat,
-    const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
+    const Descriptor &source, int32_t allocIdx, int64_t *stream, bool *pinned,
+    bool hasStat, const Descriptor *errMsg, const char *sourceFile,
+    int sourceLine) {
   int stat{RTNAME(CUFAllocatableAllocateSync)(alloc, allocIdx, stream, pinned,
       hasStat, errMsg, sourceFile, sourceLine)};
   if (stat == StatOk) {

``````````

</details>


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


More information about the llvm-commits mailing list