Skip to content
Merged
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
7 changes: 7 additions & 0 deletions ext/MatrixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ end

MatrixAlgebraKit.supports_svd_full(::ROCSOLVER, f::Symbol) = f in (:qr_iteration, :jacobi, :divide_and_conquer, :bisection)

# one kernel for the whole triangle instead of one per column
function MatrixAlgebraKit.uppertriangular!(A::StridedROCMatrix)
m, n = size(A)
A .= ifelse.((1:m) .> transpose(1:n), zero(eltype(A)), A)
return A
end

# rocSOLVER's `gesvd*_batched` functions take the batch as an array
# of device pointers, so a group of equally sized matrices
# doesn't need a copy into a 3D ROCArray.
Expand Down
7 changes: 7 additions & 0 deletions ext/MatrixAlgebraKitCUDAExt/MatrixAlgebraKitCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ end

MatrixAlgebraKit.prefers_ungqr(::CUSOLVER) = true

# one kernel for the whole triangle instead of one per column
function MatrixAlgebraKit.uppertriangular!(A::StridedCuMatrix)
m, n = size(A)
A .= ifelse.((1:m) .> transpose(1:n), zero(eltype(A)), A)
return A
end

MatrixAlgebraKit.supports_svd_full(::CUSOLVER, f::Symbol) = f in (:qr_iteration, :jacobi, :svd_polar)

# `cusolverDnXgesvdjBatched` only accepts matrices up to 32x32
Expand Down
Loading