Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot initialize CudaArray with Int32 size #28

Open
denizyuret opened this issue Sep 19, 2015 · 1 comment
Open

cannot initialize CudaArray with Int32 size #28

denizyuret opened this issue Sep 19, 2015 · 1 comment
Milestone

Comments

@denizyuret
Copy link
Contributor

This took me a while to figure out today, while debugging the new CUSPARSE package:

ERROR: LoadError: MethodError: `convert` has no method matching convert(::Type{CUDArt.CudaArray{T,N}}, ::Type{Int32}, ::Tuple{Int32})
This may have arisen from a call to the constructor CUDArt.CudaArray{T,N}(...),
since type constructors fall back to convert methods.
Closest candidates are:
  CUDArt.CudaArray(::Type{T}, !Matched::Integer...)
  CUDArt.CudaArray(::Type{T}, !Matched::Tuple{Vararg{Int64}})
  call{T}(::Type{T}, ::Any)
  ...

The relevant part from arrays.jl:

CudaArray(T::Type, dims::Integer...) = CudaArray(T, dims)

function CudaArray(T::Type, dims::Dims)

i.e. CudaArray(T,Int32) is happy, but CudaArray(T,(Int32,)) is not. Dims is defined strictly as Int64:

Dims => Tuple{Vararg{Int64}}

Should Dims also be Tuple{Vararg{Integer}} ? Maybe this is a Base problem...

@timholy
Copy link
Contributor

timholy commented Sep 19, 2015

Not a Base problem. We need a second method that takes a tuple input. Good catch!

@vchuravy vchuravy self-assigned this Feb 17, 2017
@vchuravy vchuravy added this to the v0.3 milestone Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants