@@ -170,7 +170,7 @@ for T in (UpperTriangular, LowerTriangular, UnitUpperTriangular, UnitLowerTriang
170
170
@eval Base. copyto! (A:: $T{T, <:AbstractGPUArray{T,N}} , B:: $T{T, <:AbstractGPUArray{T,N}} ) where {T,N} = $ T (copyto! (parent (A), parent (B)))
171
171
end
172
172
173
- function LinearAlgebra. tril! (A:: AbstractGPUMatrix {T} , d:: Integer = 0 ) where T
173
+ function LinearAlgebra. tril! (A:: AnyGPUMatrix {T} , d:: Integer = 0 ) where T
174
174
gpu_call (A, d; name= " tril!" ) do ctx, _A, _d
175
175
I = @cartesianidx _A
176
176
i, j = Tuple (I)
@@ -182,7 +182,7 @@ function LinearAlgebra.tril!(A::AbstractGPUMatrix{T}, d::Integer = 0) where T
182
182
return A
183
183
end
184
184
185
- function LinearAlgebra. triu! (A:: AbstractGPUMatrix {T} , d:: Integer = 0 ) where T
185
+ function LinearAlgebra. triu! (A:: AnyGPUMatrix {T} , d:: Integer = 0 ) where T
186
186
gpu_call (A, d; name= " triu!" ) do ctx, _A, _d
187
187
I = @cartesianidx _A
188
188
i, j = Tuple (I)
@@ -795,3 +795,21 @@ function Base.isone(x::AbstractGPUMatrix{T}) where {T}
795
795
796
796
Array (y)[]
797
797
end
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 LinearAlgebra. 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