Skip to content

Commit 905647e

Browse files
committed
Force memory transfer
1 parent 2c34bc4 commit 905647e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/implementations/svd.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ end
229229
function svd_trunc!(A, USVᴴ::Tuple{TU, TS, TVᴴ}, alg::TruncatedAlgorithm; compute_error::Bool = true) where {TU, TS, TVᴴ}
230230
ϵ = similar(USVᴴ[2], compute_error)
231231
(U, S, Vᴴ, ϵ) = svd_trunc!(A, (USVᴴ..., ϵ), alg)
232-
return compute_error ? (U, S, Vᴴ, ϵ[1]) : (U, S, Vᴴ, -one(eltype(ϵ)))
232+
return compute_error ? (U, S, Vᴴ, collect(ϵ)[1]) : (U, S, Vᴴ, -one(eltype(ϵ)))
233233
end
234234
function svd_trunc!(A, USVᴴ::Nothing, alg::TruncatedAlgorithm; compute_error::Bool = true)
235235
Tr = real(eltype(A))
236-
ϵ = compute_error ? zeros(Tr, 1) : zeros(Tr, 0)
236+
ϵ = zeros(Tr, compute_error)
237237
U, S, Vᴴ, ϵ = svd_trunc!(A, (USVᴴ, ϵ), alg)
238-
return compute_error ? (U, S, Vᴴ, ϵ[1]) : (U, S, Vᴴ, -one(Tr))
238+
return compute_error ? (U, S, Vᴴ, collect(ϵ)[1]) : (U, S, Vᴴ, -one(Tr))
239239
end
240240

241241
# Diagonal logic

0 commit comments

Comments
 (0)