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

via flang-commits flang-commits at lists.llvm.org
Wed Jan 22 01:45:56 PST 2025


================
@@ -92,5 +92,31 @@ attributes(device) subroutine threadfence_system()
     end function
   end interface
   public :: __fadd_ru
+
+  ! Atomic Operations
   
+  interface atomicadd
+    attributes(device) pure integer function atomicaddi(address, val)
+  !dir$ ignore_tkr (rd) address, (d) val
----------------
jeanPerier wrote:

I see that one is allowed to call `atomicadd` with an address of any rank ("r"). What is the semantic of calling them with an array? Is it that the first element is modified, or that all elements are modified?

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


More information about the flang-commits mailing list