You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Not described to a specific problem. I just think that atomic min and max are very common operations and it would be convenient for developers to have it out of the box. Currently only integers are supported.
Describe the solution you'd like
Including atomic min, max for Float32 and Float64 in CUDA.jl interface.
The text was updated successfully, but these errors were encountered:
The low level atomic operations, i.e. those prefixed by atomic_, only provide what the hardware implements. For a wider set of operations, potentially falling back to a slow CAS loop, you can use the CUDA.@atomic macro, which supports min just fine:
julia>functionkernel(a)
CUDA.@atomic a[1] =min(a[1], 1)
returnend
kernel (generic function with 1 method)
julia> a =cu([42])
1-element CuArray{Int64, 1, CUDA.Mem.DeviceBuffer}:42
julia>@cudakernel(a)
CUDA.HostKernel forkernel(CuDeviceVector{Int64, 1})
julia> a
1-element CuArray{Int64, 1, CUDA.Mem.DeviceBuffer}:1
Is your feature request related to a problem? Please describe.
Not described to a specific problem. I just think that atomic min and max are very common operations and it would be convenient for developers to have it out of the box. Currently only integers are supported.
Describe the solution you'd like
Including atomic min, max for Float32 and Float64 in CUDA.jl interface.
The text was updated successfully, but these errors were encountered: