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

MethodError: ambiguous #36

Open
mfalt opened this issue Aug 11, 2017 · 1 comment
Open

MethodError: ambiguous #36

mfalt opened this issue Aug 11, 2017 · 1 comment

Comments

@mfalt
Copy link

mfalt commented Aug 11, 2017

It seems that almost any function I try give me an error because of ambiguity, am I doing something wrong?

julia> using CUSPARSE, CUDArt
julia> A = sprand(20,10,0.2)
julia> d_A = CudaSparseMatrixCSR(A) #Print error
julia> d_B = CudaArray(rand(10))
julia> d_A*d_B
ERROR: MethodError: CUSPARSE.mv!(::Char, ::Float64, ::CUSPARSE.CudaSparseMatrixCSR{Float64}, ::CUDArt.CudaArray{Float64,1}, ::Float64, ::CUDArt.CudaArray{Float64,1}, ::Char) is ambiguous. Candidates:
  mv!(transa::Char, alpha::Union{Complex{Float32}, Complex{Float64}, Float32, Float64}, A::Union{CUSPARSE.CudaSparseMatrixBSR{T}, CUSPARSE.CudaSparseMatrixCSC{T}, CUSPARSE.CudaSparseMatrixCSR{T}, CUSPARSE.CudaSparseMatrixHYB{T}} where T, X::CUDArt.CudaArray{T,1} where T, beta::Union{Complex{Float32}, Complex{Float64}, Float32, Float64}, Y::CUDArt.CudaArray{T,1} where T, index::Char) in CUSPARSE at /local/home/mattiasf/.julia/v0.6/CUSPARSE/src/sparse.jl:686
  mv!(transa::Char, alpha::Float64, A::Union{CUSPARSE.CudaSparseMatrixCSR{Float64}, Hermitian{Float64,CUSPARSE.CudaSparseMatrixCSR{Float64}}, Symmetric{Float64,CUSPARSE.CudaSparseMatrixCSR{Float64}}}, X::CUDArt.CudaArray{Float64,1}, beta::Float64, Y::CUDArt.CudaArray{Float64,1}, index::Char) in CUSPARSE at /local/home/mattiasf/.julia/v0.6/CUSPARSE/src/sparse.jl:738
Possible fix, define
  mv!(::Char, ::Float64, ::CUSPARSE.CudaSparseMatrixCSR{Float64}, ::CUDArt.CudaArray{Float64,1}, ::Float64, ::CUDArt.CudaArray{Float64,1}, ::Char)
Stacktrace:
 [1] *(::CUSPARSE.CudaSparseMatrixCSR{Float64}, ::CUDArt.CudaArray{Float64,1}) at /local/home/mattiasf/.julia/v0.6/CUSPARSE/src/sparse.jl:1769
@mfalt
Copy link
Author

mfalt commented Aug 11, 2017

It seems like the problem is the extra function that was added for the documentation, such as:

"""
    mv!(....
.....
"""
function mv!(transa::SparseChar, alpha::BlasFloat, A::CudaSparseMatrix, X::CudaVector,
             beta::BlasFloat, Y::CudaVector, index::SparseChar) end

I solved it by runing the following regex on sparse.jl to remove 24 definitions:
Regex: """\nfunction ((.*)\()(.\n{0,1})*\) end
Replace: """\n$2

See PR: #37

I'm running julia 0.6 and the tests pass after, but not before this change.

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

1 participant