Skip to content

CuArrays.CURAND.curand missing methods #141

@mohdibntarek

Description

@mohdibntarek

There seems to be a few missing methods for curand. The no argument method returns an array, but should it? And the range method is not defined:

julia> x = CuArrays.CURAND.curand()
0-dimensional CuArray{Float32,0}:
0.15776986

julia> x = CuArrays.CURAND.curand(-1:2:1)
ERROR: MethodError: no method matching CuArray{Float32,N} where N(::UndefInitializer, ::StepRange{Int64,Int64})
Closest candidates are:
  CuArray{Float32,N} where N(::UndefInitializer, ::Tuple{Vararg{Int64,N}}) where {T, N} at C:\Users\user\.julia\dev\CuArrays\src\array.jl:45
  CuArray{Float32,N} where N(::UndefInitializer, ::Integer...) where T at C:\Users\user\.julia\dev\CuArrays\src\array.jl:46
  CuArray{Float32,N} where N(::Function, ::Any...) where T at C:\Users\user\.julia\dev\CuArrays\src\array.jl:56
Stacktrace:
 [1] #curand#22(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Type{Float32}, ::StepRange{Int64,Int64}, ::Vararg{Any,N} where N) at C:\Users\user\.julia\dev\CuArrays\src\rand\highlevel.jl:81
 [2] curand(::Type{Float32}, ::StepRange{Int64,Int64}) at C:\Users\user\.julia\dev\CuArrays\src\rand\highlevel.jl:81
 [3] #curand#26(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::StepRange{Int64,Int64}) at C:\Users\user\.julia\dev\CuArrays\src\rand\highlevel.jl:87
 [4] curand(::StepRange{Int64,Int64}) at C:\Users\user\.julia\dev\CuArrays\src\rand\highlevel.jl:87
 [5] top-level scope at none:0

I am sure there are more, but these are the ones that came up in the context of https://github.com/luca-aki/TraceEstimation.jl, where an input rand function is to be given that is assumed to have the above methods defined.

CC: @luca-aki

Metadata

Metadata

Assignees

No one assigned

    Labels

    cuda arrayStuff about CuArray.enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions