@@ -5,7 +5,9 @@ import ForwardDiff
55import SparseDiffTools: AbstractMaybeSparseJacobianCache, AbstractMaybeSparsityDetection,
66 ForwardColorJacCache, NoMatrixColoring, sparse_jacobian_cache,
77 sparse_jacobian!,
8- sparse_jacobian_static_array, __standard_tag, __chunksize
8+ sparse_jacobian_static_array, __standard_tag, __chunksize,
9+ polyesterforwarddiff_color_jacobian,
10+ polyesterforwarddiff_color_jacobian!
911
1012struct PolyesterForwardDiffJacobianCache{CO, CA, J, FX, X} < :
1113 AbstractMaybeSparseJacobianCache
@@ -25,8 +27,6 @@ function sparse_jacobian_cache(
2527 cache = __chunksize (ad, x)
2628 jac_prototype = nothing
2729 else
28- @warn """ Currently PolyesterForwardDiff does not support sparsity detection
29- natively. Falling back to using ForwardDiff.jl""" maxlog= 1
3030 tag = __standard_tag (nothing , x)
3131 # Colored ForwardDiff passes `tag` directly into Dual so we need the `typeof`
3232 cache = ForwardColorJacCache (f, x, __chunksize (ad); coloring_result. colorvec,
@@ -45,7 +45,8 @@ function sparse_jacobian_cache(
4545 jac_prototype = nothing
4646 else
4747 @warn """ Currently PolyesterForwardDiff does not support sparsity detection
48- natively. Falling back to using ForwardDiff.jl""" maxlog= 1
48+ natively for inplace functions. Falling back to using
49+ ForwardDiff.jl""" maxlog= 1
4950 tag = __standard_tag (nothing , x)
5051 # Colored ForwardDiff passes `tag` directly into Dual so we need the `typeof`
5152 cache = ForwardColorJacCache (f!, x, __chunksize (ad); coloring_result. colorvec,
5859function sparse_jacobian! (J:: AbstractMatrix , _, cache:: PolyesterForwardDiffJacobianCache ,
5960 f:: F , x) where {F}
6061 if cache. cache isa ForwardColorJacCache
61- forwarddiff_color_jacobian (J, f, x, cache. cache) # Use Sparse ForwardDiff
62+ polyesterforwarddiff_color_jacobian (J, f, x, cache. cache)
6263 else
6364 PolyesterForwardDiff. threaded_jacobian! (f, J, x, cache. cache) # Don't try to exploit sparsity
6465 end
6869function sparse_jacobian! (J:: AbstractMatrix , _, cache:: PolyesterForwardDiffJacobianCache ,
6970 f!:: F , fx, x) where {F}
7071 if cache. cache isa ForwardColorJacCache
71- forwarddiff_color_jacobian! (J, f!, x, cache. cache) # Use Sparse ForwardDiff
72+ forwarddiff_color_jacobian! (J, f!, x, cache. cache)
7273 else
7374 PolyesterForwardDiff. threaded_jacobian! (f!, fx, J, x, cache. cache) # Don't try to exploit sparsity
7475 end
0 commit comments