Skip to content

Commit

Permalink
specialize ipiv2perm for CPUStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
tgymnich committed Mar 11, 2024
1 parent 69fa85d commit 5ee17c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/mps/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ end

# Metal's pivoting sequence needs to be iterated sequentially...
# TODO: figure out a GPU-compatible way to get the permutation matrix
LinearAlgebra.ipiv2perm(v::MtlVector{T}, maxi::Integer) where T = LinearAlgebra.ipiv2perm(Array(v), maxi)
LinearAlgebra.ipiv2perm(v::MtlVector{T,S}, maxi::Integer) where {T,S} = LinearAlgebra.ipiv2perm(Array(v), maxi)
LinearAlgebra.ipiv2perm(v::MtlVector{T,S}, maxi::Integer) where {T,S<:CPUStorage} = LinearAlgebra.ipiv2perm(unsafe_wrap(Array, v), maxi)

function LinearAlgebra.lu(A::MtlMatrix{T}; check::Bool = true) where {T<:MtlFloat}
M,N = size(A)
Expand Down

0 comments on commit 5ee17c9

Please sign in to comment.