-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
BLAS/LAPACK calls need numeric traits #154
Comments
Another option that Jeff suggested is to pair the type and the array in a tuple, e.g., some_blas_call(A::StridedArray) = some_blas_call((A,blastype(eltype(A))))
function some_blas_call{T<:BlasComplex}(Atype::(StridedArray,Type{T}))
A = Atype[1]
# the version that calls blas goes here
end
function some_blas_call{T}(Atype::(StridedArray,Type{T}))
A = Atype[1]
# the generic fallback goes here
end This has the advantage that you don't have to worry about which type goes with which argument. I've been burned with this in creating |
A possible use case is unitful matrix computations, c.f. #128. |
+1. |
Agreed, might as well do both at once. |
I like the purpose of this, but I think we should think about the structure of all of our matrix multiplication and solve code here. Maybe it can be simplified while adding this functionality. Right now when multiplying two matrices
Having a version of Also, so far I think the guideline has been that the I have a branch that adds pointer version of the BLAS 2 and 3 wrappers. These might be useful for adding support for wrapped BLAS floats. I think it is done, but I got a little tired writing tests for the new methods, which is why it is not in master yet. |
👍 |
Not sure how to get tackle this issue in that PR though. |
@dlfivefifty , one way to encode the information that I don't think I do a good job in explaining and its probably not easy to implement, but it would be something that an |
Yes that's not a bad idea... but I do prefer the update to It also doesn't solve the problem that |
If I wrap a numeric type, I can't use BLAS or LAPACK calls anymore. This hurts performance considerably:
It's using the
generic_matmatmul!
fallback, since aMyEl{Float64}
is not recognized as a type that one can pass to BLAS/LAPACK.It would seem that the best approach would be to define a set of numeric traits and have the BLAS/LAPACK routines use them. I'm submitting this issue to open discussion about how best to do this. Here's one proposal:
[cjh: colorized]
The text was updated successfully, but these errors were encountered: