Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions ext/MatrixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,43 +159,4 @@ function MatrixAlgebraKit._avgdiff!(A::StridedROCMatrix, B::StridedROCMatrix)
return A, B
end

function MatrixAlgebraKit.truncate(
::typeof(left_null!), US::Tuple{TU, TS}, strategy::TruncationStrategy
) where {TU <: ROCMatrix, TS}
# TODO: avoid allocation?
U, S = US
extended_S = vcat(diagview(S), zeros(eltype(S), max(0, size(S, 1) - size(S, 2))))
ind = MatrixAlgebraKit.findtruncated(extended_S, strategy)
trunc_cols = collect(1:size(U, 2))[ind]
Utrunc = U[:, trunc_cols]
return Utrunc, ind
end
function MatrixAlgebraKit.truncate(
::typeof(right_null!), SVᴴ::Tuple{TS, TVᴴ}, strategy::TruncationStrategy
) where {TS, TVᴴ <: ROCMatrix}
# TODO: avoid allocation?
S, Vᴴ = SVᴴ
extended_S = vcat(diagview(S), zeros(eltype(S), max(0, size(S, 2) - size(S, 1))))
ind = MatrixAlgebraKit.findtruncated(extended_S, strategy)
trunc_rows = collect(1:size(Vᴴ, 1))[ind]
Vᴴtrunc = Vᴴ[trunc_rows, :]
return Vᴴtrunc, ind
end

# disambiguate:
function MatrixAlgebraKit.truncate(
::typeof(left_null!), (U, S)::Tuple{TU, TS}, ::NoTruncation
) where {TU <: ROCMatrix, TS}
m, n = size(S)
ind = (n + 1):m
return U[:, ind], ind
end
function MatrixAlgebraKit.truncate(
::typeof(right_null!), (S, Vᴴ)::Tuple{TS, TVᴴ}, ::NoTruncation
) where {TS, TVᴴ <: ROCMatrix}
m, n = size(S)
ind = (m + 1):n
return Vᴴ[ind, :], ind
end

end
3 changes: 3 additions & 0 deletions ext/MatrixAlgebraKitGenericLinearAlgebraExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module MatrixAlgebraKitGenericLinearAlgebraExt

using MatrixAlgebraKit
using MatrixAlgebraKit: sign_safe, check_input, diagview, gaugefix!, one!, default_fixgauge
using MatrixAlgebraKit: left_orth_alg
using GenericLinearAlgebra: svd!, svdvals!, eigen!, eigvals!, Hermitian, qr!
using LinearAlgebra: I, Diagonal, lmul!

Expand Down Expand Up @@ -133,4 +134,6 @@ function MatrixAlgebraKit.default_lq_algorithm(::Type{T}; kwargs...) where {T <:
return MatrixAlgebraKit.LQViaTransposedQR(GLA_HouseholderQR(; kwargs...))
end

MatrixAlgebraKit.left_orth_alg(alg::GLA_HouseholderQR) = MatrixAlgebraKit.LeftOrthViaQR(alg)

end
285 changes: 0 additions & 285 deletions test/amd/orthnull.jl

This file was deleted.

Loading