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

via flang-commits flang-commits at lists.llvm.org
Tue Apr 16 02:44:41 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");
----------------
jeanPerier wrote:

I do not get why it is allowed for the box argument to be a simple fir.box<> (an not a fir.ref<fir.box<>>), how can the fir.box be modified after the allocation?

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


More information about the flang-commits mailing list