[flang-commits] [flang] [flang][cuda] Convert data transfer between scalar and arrays (PR #110180)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Thu Sep 26 15:40:24 PDT 2024


================
@@ -334,7 +329,62 @@ struct CufDataTransferOpConversion
     auto mod = op->getParentOfType<mlir::ModuleOp>();
     fir::FirOpBuilder builder(rewriter, mod);
     mlir::Location loc = op.getLoc();
+    fir::KindMapping kindMap{fir::getKindMapping(mod)};
+    mlir::Value modeValue =
+        builder.createIntegerConstant(loc, builder.getI32Type(), mode);
+
+    // Convert data transfer without any descriptor.
+    if (!mlir::isa<fir::BaseBoxType>(srcTy) &&
+        !mlir::isa<fir::BaseBoxType>(dstTy)) {
+
+      if (fir::isa_trivial(srcTy) && !fir::isa_trivial(dstTy)) {
+        // TODO: scalar to array data transfer.
+        return mlir::failure();
----------------
clementval wrote:

Yes you are correct. The message would be a bit criptic to understand. I don't expect it to stay like this for long but I'm gonna add a more intuitive error message for the time being.

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


More information about the flang-commits mailing list