Skip to content

Commit 7bb5f08

Browse files
authored
Replace .*(Number, Diagonal) with *(Number, Diagonal)
The result with / without broadcasting here is the same. Removing the broadcast here would avoid JuliaGPU/CUDA.jl#2140. Further, when `cache.DtD.diag isa ComponentVector` that CUDA bug would lead to scalar indexing error on GPU.
1 parent 1e4c3c0 commit 7bb5f08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/levenberg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false, fastls}) where {fas
374374

375375
# Usual Levenberg-Marquardt step ("velocity").
376376
if fastls
377-
cache.mat_tmp = vcat(J, λ .* cache.DᵀD)
377+
cache.mat_tmp = vcat(J, λ * cache.DᵀD)
378378
cache.rhs_tmp[1:length(fu1)] .= -_vec(fu1)
379379
linres = dolinsolve(alg.precs, linsolve; A = cache.mat_tmp,
380380
b = cache.rhs_tmp, linu = _vec(cache.v), p = p, reltol = cache.abstol)

0 commit comments

Comments
 (0)