[flang-commits] [flang] [flang][cuda] Add new entry points function for data transfer (PR #108244)

via flang-commits flang-commits at lists.llvm.org
Wed Sep 11 09:14:05 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 7858e14547c509c95503b74ff8ffc7bf2fc5b110 968d2ddfdd648a2e34e53a9a662066688b7010c1 --extensions h,cpp -- flang/include/flang/Runtime/CUDA/memory.h flang/runtime/CUDA/memory.cpp flang/lib/Optimizer/Dialect/FIRType.cpp
``````````

</details>

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

``````````diff
diff --git a/flang/include/flang/Runtime/CUDA/memory.h b/flang/include/flang/Runtime/CUDA/memory.h
index 39fd333152..9aca4016e7 100644
--- a/flang/include/flang/Runtime/CUDA/memory.h
+++ b/flang/include/flang/Runtime/CUDA/memory.h
@@ -22,7 +22,7 @@ namespace Fortran::runtime::cuda {
 extern "C" {
 
 // Set value to the data hold by a descriptor.
-void RTDECL(CUFMemsetDescriptor)(const Descriptor &desc, void* value,
+void RTDECL(CUFMemsetDescriptor)(const Descriptor &desc, void *value,
     const char *sourceFile = nullptr, int sourceLine = 0);
 
 // Data transfer from a pointer to a descriptor.
diff --git a/flang/runtime/CUDA/memory.cpp b/flang/runtime/CUDA/memory.cpp
index 34eee34762..a287fa14a4 100644
--- a/flang/runtime/CUDA/memory.cpp
+++ b/flang/runtime/CUDA/memory.cpp
@@ -14,24 +14,22 @@
 namespace Fortran::runtime::cuda {
 extern "C" {
 
-void RTDEF(CUFMemsetDescriptor)(const Descriptor &desc, void* value,
+void RTDEF(CUFMemsetDescriptor)(const Descriptor &desc, void *value,
     const char *sourceFile, int sourceLine) {
   Terminator terminator{sourceFile, sourceLine};
-  terminator.Crash(
-      "not yet implemented: CUDA data transfer from a scalar value to a descriptor");
+  terminator.Crash("not yet implemented: CUDA data transfer from a scalar "
+                   "value to a descriptor");
 }
 
 void RTDEF(CUFDataTransferDescPtr)(const Descriptor &desc, void *addr,
-    std::size_t bytes, unsigned mode, const char *sourceFile,
-    int sourceLine) {
+    std::size_t bytes, unsigned mode, const char *sourceFile, int sourceLine) {
   Terminator terminator{sourceFile, sourceLine};
   terminator.Crash(
       "not yet implemented: CUDA data transfer from a pointer to a descriptor");
 }
 
-void RTDEF(CUFDataTransferPtrDesc)(void* addr, const Descriptor &desc,
-    std::size_t bytes, unsigned mode, const char *sourceFile,
-    int sourceLine) {
+void RTDEF(CUFDataTransferPtrDesc)(void *addr, const Descriptor &desc,
+    std::size_t bytes, unsigned mode, const char *sourceFile, int sourceLine) {
   Terminator terminator{sourceFile, sourceLine};
   terminator.Crash(
       "not yet implemented: CUDA data transfer from a descriptor to a pointer");
@@ -44,6 +42,5 @@ void RTDECL(CUFDataTransferDescDesc)(const Descriptor &dstDesc,
   terminator.Crash(
       "not yet implemented: CUDA data transfer between two descriptors");
 }
-
 }
 } // namespace Fortran::runtime::cuda

``````````

</details>


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


More information about the flang-commits mailing list