[flang-commits] [flang] [flang][cuda] cuf.allocate: Carry over stream to the runtime call (PR #117631)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Mon Nov 25 14:58:19 PST 2024


Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Valentin Clement
 <clementval at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/117631 at github.com>


================
@@ -47,9 +39,25 @@ int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, bool hasStat,
   return stat;
 }
 
+int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, long stream,
+    bool hasStat, const Descriptor *errMsg, const char *sourceFile,
+    int sourceLine) {
+  if (desc.HasAddendum()) {
+    Terminator terminator{sourceFile, sourceLine};
+    // TODO: This require a bit more work to set the correct type descriptor
+    // address
+    terminator.Crash(
+        "not yet implemented: CUDA descriptor allocation with addendum");
+  }
+  // Perform the standard allocation.
+  int stat{RTNAME(AllocatableAllocate)(
+      desc, hasStat, errMsg, sourceFile, sourceLine)};
+  return stat;
+}
+
 int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
-    const Descriptor &source, bool hasStat, const Descriptor *errMsg,
-    const char *sourceFile, int sourceLine) {
+    const Descriptor &source, long stream, bool hasStat,
----------------
clementval wrote:

Yes 74 too and needed to call `CUFAllocatableAllocateSync` instead. The only place where the `stream` is not currently used/passed is in the base implementation  in `CUFAllocatableAllocate` because we don't have a mean to pass it yet. 

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


More information about the flang-commits mailing list