Skip to content

Commit 39f2ee6

Browse files
Sparse GPU take 2
1 parent c438420 commit 39f2ee6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/differentiation/compute_jacobian_ad.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,9 @@ function forwarddiff_color_jacobian!(J::AbstractMatrix{<:Number},
357357
+= means requires a zero'd out start
358358
=#
359359
if J isa AbstractSparseMatrix
360-
@. setindex!((J.nzval,),getindex((J.nzval,),rows_index) + (getindex((colorvec,),cols_index) == color_i) * getindex((vecdx,),rows_index),rows_index)
360+
@. void_setindex!(Ref(nonzeros(J)),getindex(Ref(nonzeros(J)),rows_index) + (getindex(Ref(colorvec),cols_index) == color_i) * getindex(Ref(vecdx),rows_index),rows_index)
361361
else
362-
@. setindex!((J,),getindex((J,),rows_index, cols_index) + (getindex((colorvec,),cols_index) == color_i) * getindex((vecdx,),rows_index),rows_index, cols_index)
362+
@. void_setindex!(Ref(J),getindex(Ref(J),rows_index, cols_index) + (getindex(Ref(colorvec),cols_index) == color_i) * getindex(Ref(vecdx),rows_index),rows_index, cols_index)
363363
end
364364
end
365365
color_i += 1

0 commit comments

Comments
 (0)