-
Notifications
You must be signed in to change notification settings - Fork 243
Fixed reducedim operations for CuQRPackedQ #1118
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,14 @@ Base.size(A::CuQRPackedQ, dim::Integer) = 0 < dim ? (dim <= 2 ? size(A.factors, | |
CUDA.CuMatrix(A::CuQRPackedQ) = orgqr!(copy(A.factors), A.τ) | ||
CUDA.CuArray(A::CuQRPackedQ) = CuMatrix(A) | ||
Base.Matrix(A::CuQRPackedQ) = Matrix(CuMatrix(A)) | ||
Base.similar(A::CuQRPackedQ{S,T}) where {S,T} = CuArray{S, ndims(a)}(undef, size(a)) | ||
|
||
# CuQRPackedQ isn't an AbstractGPUArray, so we miss out on lots of GPU-compatible methods. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we want the same for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't it be an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How? It's currently a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yeah, that is true |
||
# add a couple common methods here that avoid GPU-incompatible fallbacks. | ||
Base.sum(xs::CuQRPackedQ) = sum(CuArray(xs)) | ||
Base.prod(xs::CuQRPackedQ) = prod(CuArray(xs)) | ||
Base.maximum(xs::CuQRPackedQ) = maximum(CuArray(xs)) | ||
Base.minimum(xs::CuQRPackedQ) = minimum(CuArray(xs)) | ||
|
||
function Base.getproperty(A::CuQR, d::Symbol) | ||
m, n = size(getfield(A, :factors)) | ||
|
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.
a
vsA
T
andS
are switched around compared to theCuQRPackedQ
definitionAlso, can't you get
N
statically from S typevar?