[flang-commits] [flang] [flang][cuda] Add fir.cuda_allocate operation (PR #88586)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Tue Apr 16 08:00:59 PDT 2024


================
@@ -3993,6 +3993,25 @@ mlir::LogicalResult fir::CUDAKernelOp::verify() {
   return mlir::success();
 }
 
+mlir::LogicalResult fir::CUDAAllocateOp::verify() {
+  if (getPinned() && getStream())
+    return emitOpError("pinned and stream cannot appears at the same time");
+  if (!fir::unwrapRefType(getBox().getType()).isa<fir::BaseBoxType>())
+    return emitOpError(
+        "expect box to be a reference to/or a class or box type value");
----------------
clementval wrote:

It should be a reference to a box. You are correct that the box needs to be updated after the allocation so it does not make sense to have a simple fir.box<>. I'll make the change and open a PR.

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


More information about the flang-commits mailing list