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

Unable to use Dgemm #12

Open
nstiurca opened this issue Nov 13, 2015 · 5 comments
Open

Unable to use Dgemm #12

nstiurca opened this issue Nov 13, 2015 · 5 comments

Comments

@nstiurca
Copy link
Contributor

I'm trying to use GEMM with double-precision floats, but that doesn't seem supported? I tried a straight-forward adaptation of the clblasSgemm_future.jl and clblasSgemmRandomBufferFuture.jl examples to use Float64/cl.cl_double, but I get the following errors.

$ julia clblasDgemm_future.jl
WARNING: float64(x::AbstractArray) is deprecated, use map(Float64,x) instead.
 in depwarn at deprecated.jl:73
 in float64 at deprecated.jl:50
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /home/nstiurca/.julia/v0.4/CLBLAS/examples/clblasDgemm_future.jl, in expression starting on line 9
WARNING: float64(x::AbstractArray) is deprecated, use map(Float64,x) instead.
 in depwarn at deprecated.jl:73
 in float64 at deprecated.jl:50
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /home/nstiurca/.julia/v0.4/CLBLAS/examples/clblasDgemm_future.jl, in expression starting on line 10
ERROR: LoadError: MethodError: `clblasDgemm` has no method matching clblasDgemm(::UInt32, ::UInt32, ::Float64, ::Array{Float64,2}, ::Array{Float64,2}, ::Float64, ::Array{Float64,2})
Closest candidates are:
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Array{OpenCL.CmdQueue,1})
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Array{OpenCL.CmdQueue,1}, !Matched::Union{Array{Ptr{Void},1},Void})
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any)
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /home/nstiurca/.julia/v0.4/CLBLAS/examples/clblasDgemm_future.jl, in expression starting on line 15

and

$ julia clblasDgemmRandomBufferFuture.jl
ERROR: LoadError: MethodError: `clblasDgemm` has no method matching clblasDgemm(::UInt32, ::UInt32, ::Float64, ::OpenCL.Buffer{Float64}, ::OpenCL.Buffer{Float64}, ::Float64, ::OpenCL.Buffer{Float64})
Closest candidates are:
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Array{OpenCL.CmdQueue,1})
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Array{OpenCL.CmdQueue,1}, !Matched::Union{Array{Ptr{Void},1},Void})
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any)
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /home/nstiurca/.julia/v0.4/CLBLAS/examples/clblasDgemmRandomBufferFuture.jl, in expression starting on line 26

I am using Linux Mint 17.2 (essentially Ubuntu 14.04), clBLAS v2.6, Julia v0.4, latest CLBLAS.jl master (currently 1555379).

@nstiurca
Copy link
Contributor Author

Here is the code I used: https://gist.github.com/nstiurca/6b91103ad31a4d9b5c09

@jakebolewski
Copy link
Member

@nstiurca can you try again now that #11 is merged?

@dfdx
Copy link
Contributor

dfdx commented Nov 13, 2015

It's pretty possible that you will still get an error, because clblasSgemm uses a type trick, replacing enum parameter with UInt, and newer API controls argument types much more strictly.

Note, that I'm currently working on a high-level interface for CLBLAS.jl based on CLArrays. So if futures aren't essential for your work, you can just wait for a couple of days and get all "GEMM" functions out of the box.

@nstiurca
Copy link
Contributor Author

Thank you guys. I haven't gotten my code working yet, but that is largely because I was working on a patch to address the issues with enum/UInt and the very strict new API. My approach is that if the C type is a specific thing like size_t, then the corresponding Julia function should accept any Number, and do the conversion as necessary when actually invoking ccall. That would allow passing in 0 instead of UInt(0), etc.

By the way, I think enums should map to Cint rather than UInt, which I think would be the correct signed-ness and bit-size.

And I look forward to the CLArray implementation.

@nstiurca
Copy link
Contributor Author

See PR #13 for my aforementioned patch.

dfdx added a commit that referenced this issue Nov 28, 2015
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