Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

importall BLAS for generic code #1

Open
denizyuret opened this issue Feb 22, 2015 · 5 comments
Open

importall BLAS for generic code #1

denizyuret opened this issue Feb 22, 2015 · 5 comments

Comments

@denizyuret
Copy link
Contributor

Hi Nick,

Currently CUBLAS does not export or modify any existing functions, but provides separate CUBLAS versions like CUBLAS.axpy! etc. (If I understand things correctly). If you add the line:

importall Base.LinAlg.BLAS

to the beginning of CUBLAS.jl, (see module usage), then it will be possible for the users to write generic code that works whether the inputs are Arrays or CudaArrays.

best,
deniz

@lucasb-eyer
Copy link

👍 what's the status of this?

@lucasb-eyer
Copy link

Nevermind, I just saw you did this in 217c8d7, so close this issue?

@dpo
Copy link

dpo commented Dec 4, 2015

Does this really work?

julia> using CUDArt
julia> using CUBLAS
julia> x = rand(10); y = rand(10);
julia> d_x = CudaArray(x); d_y = CudaArray(y);
julia> dot(d_x, d_y)
ERROR: MethodError: `dot` has no method matching dot(::CUDArt.CudaArray{Float64,1}, ::CUDArt.CudaArray{Float64,1})
julia> VERSION
v"0.4.1"

@denizyuret
Copy link
Contributor Author

I think dot is in Base.LinAlg rather than Base.LinAlg.BLAS. We should
probably importall that as well. I'll test this.

On Thu, Dec 3, 2015 at 6:18 PM Dominique [email protected] wrote:

Does this really work?

julia> using CUDArt
julia> using CUBLAS
julia> x = rand(10); y = rand(10);
julia> d_x = CudaArray(x); d_y = CudaArray(y);
julia> dot(d_x, d_y)
ERROR: MethodError: dot has no method matching dot(::CUDArt.CudaArray{Float64,1}, ::CUDArt.CudaArray{Float64,1})
julia> VERSIONv"0.4.1"


Reply to this email directly or view it on GitHub
#1 (comment).

@denizyuret
Copy link
Contributor Author

Hmm, it seems a bit more complicated. Base.LinAlg and Base.LinAlg.BLAS each export a different version of dot, so it is not clear which we should extend. I submitted an issue about this: JuliaLang/LinearAlgebra.jl#289

@denizyuret denizyuret reopened this Dec 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants