@@ -85,7 +85,7 @@ for T in (Int32, Int64, UInt32, UInt64)
8585 end
8686end
8787
88- for T in (Float32, Float64)
88+ for T in (: Float32 , : Float64 )
8989 ops = [:add ]
9090
9191 for op in ops
@@ -135,13 +135,13 @@ end
135135 end
136136end
137137
138- for T in (Int32, Int64, UInt32, UInt64)
138+ for T in (: Int32 , : Int64 , : UInt32 , : UInt64 )
139139 @eval @inline atomic_cas! (ptr:: LLVMPtr{$T} , cmp:: $T , val:: $T ) =
140140 llvm_atomic_cas (ptr, cmp, val)
141141end
142142
143143# NVPTX doesn't support cmpxchg with i16 yet
144- for A in (AS. Generic, AS. Global, AS. Shared), T in (Int16, UInt16)
144+ for A in (AS. Generic, AS. Global, AS. Shared), T in (: Int16 , : UInt16 )
145145 if A == AS. Global
146146 scope = " .global"
147147 elseif A == AS. Shared
182182
183183# half-precision atomics using PTX instruction
184184
185- for A in (AS. Generic, AS. Global, AS. Shared), T in (Float16,)
185+ for A in (AS. Generic, AS. Global, AS. Shared), T in (: Float16 ,)
186186 if A == AS. Global
187187 scope = " .global"
188188 elseif A == AS. Shared
@@ -207,7 +207,7 @@ inttype(::Type{Float32}) = Int32
207207inttype (:: Type{Float64} ) = Int64
208208inttype (:: Type{BFloat16} ) = Int16
209209
210- for T in [Float16, Float32, Float64, BFloat16]
210+ for T in [: Float16 , : Float32 , : Float64 , : BFloat16 ]
211211 @eval @inline function atomic_cas! (ptr:: LLVMPtr{$T,A} , cmp:: $T , new:: $T ) where {A}
212212 IT = inttype ($ T)
213213 cmp_i = reinterpret (IT, cmp)
@@ -445,13 +445,13 @@ end
445445 atomic_arrayset (A, Base. _to_linear_index (A, Is... ), op, convert (T, val))
446446
447447# native atomics
448- for (op,impl,typ) in [(+ , atomic_add!, [UInt32,Int32,UInt64,Int64,Float32]),
449- (- , atomic_sub!, [UInt32,Int32,UInt64,Int64,Float32]),
450- (& , atomic_and!, [UInt32,Int32,UInt64,Int64]),
451- (| , atomic_or!, [UInt32,Int32,UInt64,Int64]),
452- (⊻ , atomic_xor!, [UInt32,Int32,UInt64,Int64]),
453- (max, atomic_max!, [UInt32,Int32,UInt64,Int64]),
454- (min, atomic_min!, [UInt32,Int32,UInt64,Int64])]
448+ for (op,impl,typ) in [(:( + ), :( atomic_add!) , [: UInt32 ,: Int32 ,: UInt64 ,: Int64 ,: Float32 ]),
449+ (:( - ), :( atomic_sub!) , [: UInt32 ,: Int32 ,: UInt64 ,: Int64 ,: Float32 ]),
450+ (:( & ), :( atomic_and!) , [: UInt32 ,: Int32 ,: UInt64 ,: Int64 ]),
451+ (:( | ), :( atomic_or!) , [: UInt32 ,: Int32 ,: UInt64 ,: Int64 ]),
452+ (:( ⊻ ), :( atomic_xor!) , [: UInt32 ,: Int32 ,: UInt64 ,: Int64 ]),
453+ (: max , :( atomic_max!) , [: UInt32 ,: Int32 ,: UInt64 ,: Int64 ]),
454+ (: min , :( atomic_min!) , [: UInt32 ,: Int32 ,: UInt64 ,: Int64 ])]
455455 @eval @inline atomic_arrayset (A:: AbstractArray{T} , I:: Integer , :: typeof ($ op),
456456 val:: T ) where {T<: Union{$(typ...)} } =
457457 $ impl (pointer (A, I), val)
0 commit comments