-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Use Ref{T} type for BLAS calls #11402
Conversation
I'm also interested in the answer to your question. |
ccall(($(blasfunc(fname)), libblas), Void, | ||
(BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), | ||
(BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ref{$elty}), | ||
n, DX, incx, DY, incy, result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit surprised that not all of the existing arguments were Ptr. @viralshah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, @ViralBShah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specific symbol is from the CBLAS API to avoid returning a complex value. In the C API, the scalar inputs are not pointers.
Lgtm |
@simonbyrne Could you rebase and merge this? |
0aef12a
to
79adca4
Compare
Use Ref{T} type for BLAS calls
I was trying to figure out how the new
Ref
object works, so I translated the ccalls inblas.jl
to the new style.Is this the correct usage? In particular, for getting return values by reference:
julia/base/linalg/blas.jl
Lines 124 to 128 in 940c790
cc: @vtjnash, @jiahao, @andreasnoack