[flang-commits] [flang] [flang][cuda] Adding atomicadd as a cudadevice intrinsic and converting it LLVM dialect (PR #123840)

via flang-commits flang-commits at lists.llvm.org
Thu Jan 23 01:41:14 PST 2025


================
@@ -2574,6 +2578,26 @@ mlir::Value IntrinsicLibrary::genAtanpi(mlir::Type resultType,
   return builder.create<mlir::arith::MulFOp>(loc, atan, factor);
 }
 
+static mlir::Value genAtomBinOp(fir::FirOpBuilder &builder, mlir::Location &loc,
+                                mlir::LLVM::AtomicBinOp binOp, mlir::Value arg0,
+                                mlir::Value arg1) {
+  auto llvmPointerType = mlir::LLVM::LLVMPointerType::get(builder.getContext());
----------------
jeanPerier wrote:

Right, the effect description is not straightforward. If found this patch that explains some of it: https://github.com/llvm/llvm-project/commit/feb7beaf70bace1c3ffafc7f732c8fadca5e8c9d

>From what I understand, it is giving atomic operation a global write effects because the synchronization aspect (e.g., could write some global lock).

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


More information about the flang-commits mailing list