[flang-commits] [flang] [flang][cuda] Update cuf.kernel_launch stream and conversion (PR #136179)

Zhen Wang via flang-commits flang-commits at lists.llvm.org
Thu Apr 17 11:50:24 PDT 2025


================
@@ -879,8 +879,15 @@ struct CUFLaunchOpConversion
       gpuLaunchOp.getClusterSizeYMutable().assign(clusterDimY);
       gpuLaunchOp.getClusterSizeZMutable().assign(clusterDimZ);
     }
-    if (op.getStream())
-      gpuLaunchOp.getAsyncObjectMutable().assign(op.getStream());
+    if (op.getStream()) {
+      mlir::OpBuilder::InsertionGuard guard(rewriter);
+      rewriter.setInsertionPoint(gpuLaunchOp);
+      mlir::Value stream =
+          rewriter.create<cuf::StreamCastOp>(loc, op.getStream());
+      llvm::errs() << stream << "\n";
+      gpuLaunchOp.getAsyncDependenciesMutable().append(stream);
+      llvm::errs() << gpuLaunchOp << "\n";
----------------
wangzpgi wrote:

Same here.

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


More information about the flang-commits mailing list