@@ -170,7 +170,7 @@ for T in (UpperTriangular, LowerTriangular, UnitUpperTriangular, UnitLowerTriang
170170 @eval Base. copyto! (A:: $T{T, <:AbstractGPUArray{T,N}} , B:: $T{T, <:AbstractGPUArray{T,N}} ) where {T,N} = $ T (copyto! (parent (A), parent (B)))
171171end
172172
173- function LinearAlgebra. tril! (A:: AbstractGPUMatrix {T} , d:: Integer = 0 ) where T
173+ function LinearAlgebra. tril! (A:: AnyGPUMatrix {T} , d:: Integer = 0 ) where T
174174 gpu_call (A, d; name= " tril!" ) do ctx, _A, _d
175175 I = @cartesianidx _A
176176 i, j = Tuple (I)
@@ -182,7 +182,7 @@ function LinearAlgebra.tril!(A::AbstractGPUMatrix{T}, d::Integer = 0) where T
182182 return A
183183end
184184
185- function LinearAlgebra. triu! (A:: AbstractGPUMatrix {T} , d:: Integer = 0 ) where T
185+ function LinearAlgebra. triu! (A:: AnyGPUMatrix {T} , d:: Integer = 0 ) where T
186186 gpu_call (A, d; name= " triu!" ) do ctx, _A, _d
187187 I = @cartesianidx _A
188188 i, j = Tuple (I)
@@ -795,3 +795,21 @@ function Base.isone(x::AbstractGPUMatrix{T}) where {T}
795795
796796 Array (y)[]
797797end
798+
799+ # # QR
800+
801+ import LinearAlgebra: QRPackedQ
802+
803+ function LinearAlgebra. getproperty (F:: QR{T,<:AnyGPUMatrix{T}} , d:: Symbol ) where {T}
804+ m, n = size (F)
805+ if d === :R
806+ return triu! (view (getfield (F, :factors ), 1 : min (m,n), 1 : n))
807+ elseif d === :Q
808+ return QRPackedQ (getfield (F, :factors ), F. τ)
809+ else
810+ getfield (F, d)
811+ end
812+ end
813+
814+ Base. print_array (io:: IO , Q:: QRPackedQ{T,<:AnyGPUMatrix{T},<:AnyGPUMatrix{T}} ) where {T} =
815+ Base. print_array (io, collect (adapt (ToArray (), Q)))
0 commit comments