Skip to content

Commit 2baceb7

Browse files
kshyattJutho
andauthored
Update ext/MatrixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
1 parent e2921f8 commit 2baceb7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎ext/MatrixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ gesdd!(::ROCSOLVER, A::StridedROCMatrix, S::StridedROCVector, U::StridedROCMatri
118118

119119
function _gesvdx_rank1!(A::StridedROCMatrix, S::StridedROCVector, U::StridedROCMatrix, Vᴴ::StridedROCMatrix; kwargs...)
120120
select_kwargs = Base.structdiff(NamedTuple(kwargs), (; irange = nothing, vl = nothing, vu = nothing))
121-
gesvdj!(ROCSOLVER(), A, S, U, Vᴴ; select_kwargs...)
121+
S[:] .= norm(A)
122+
if m == 1
123+
Vᴴ .= A ./ S
124+
U .= 1
125+
else
126+
U .= A ./ S
127+
Vᴴ .= 1
128+
end
122129
_gesvdx_apply_range!(S, select_kwargs)
123130
return S, U, Vᴴ
124131
end

0 commit comments

Comments
 (0)