Skip to content

Commit

Permalink
Replace .*(Number, Diagonal) with *(Number, Diagonal)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vpuri3 authored Nov 1, 2023
1 parent 1e4c3c0 commit 7bb5f08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/levenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false, fastls}) where {fas

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

0 comments on commit 7bb5f08

Please sign in to comment.