Skip to content

Commit

Permalink
Fix color index
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Feb 16, 2024
1 parent 4d0c091 commit 1672644
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/SparseDiffToolsPolyesterExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ function polyesterforwarddiff_color_jacobian(J::AbstractMatrix{<:Number}, f::F,
end

batch((length(p), min(length(p), Threads.nthreads()))) do _, start, stop
color_i = (start - 1) * chunksize + 1
for i in start:stop
partial_i = p[i]
color_i = i
t_ = reshape(eltype(t).(vecx, ForwardDiff.Partials.(partial_i)), size(t))
fx = f(t_)
for j in 1:chunksize
Expand All @@ -60,6 +60,7 @@ function polyesterforwarddiff_color_jacobian(J::AbstractMatrix{<:Number}, f::F,
@inbounds @simd for i in 1:length(rows_index_c)
J[rows_index_c[i], cols_index_c[i]] = dx[rows_index_c[i]]
end

Check warning on line 62 in ext/SparseDiffToolsPolyesterExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/SparseDiffToolsPolyesterExt.jl#L62

Added line #L62 was not covered by tests
color_i += 1
end
end
end
Expand Down

0 comments on commit 1672644

Please sign in to comment.