Skip to content

Commit

Permalink
change back to checking for Val(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Nov 12, 2024
1 parent 0f40b99 commit 0f3cb76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqCore/src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ end

_get_fwd_chunksize(::Type{AutoForwardDiff{CS, T}}) where {CS, T} = Val(CS)
_get_fwd_chunksize_int(::Type{AutoForwardDiff{CS, T}}) where {CS, T} = CS
_get_fwd_chunksize(AD) = Val(1)
_get_fwd_chunksize_int(AD) = 1
_get_fwd_chunksize(AD) = Val(0)
_get_fwd_chunksize_int(AD) = 0
_get_fwd_tag(::AutoForwardDiff{CS,T}) where {CS,T} = T

_get_fdtype(::AutoFiniteDiff{T1, T2, T3}) where {T1, T2, T3} = T1
Expand Down
5 changes: 2 additions & 3 deletions lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ function build_jac_config(alg, f::F1, uf::F2, du1, uprev, u, tmp, du2) where {F1

sparsity, colorvec = sparsity_colorvec(f, u)
if alg_autodiff(alg) isa AutoForwardDiff
#_chunksize = get_chunksize(alg) === Val(0) ? nothing : get_chunksize(alg) # SparseDiffEq uses different convection...
_chunksize = get_chunksize(alg)
_chunksize = get_chunksize(alg) === Val(0) ? nothing : get_chunksize(alg) # SparseDiffEq uses different convection...
T = if standardtag(alg)
typeof(ForwardDiff.Tag(OrdinaryDiffEqTag(), eltype(u)))
else
Expand All @@ -292,7 +291,7 @@ function build_jac_config(alg, f::F1, uf::F2, du1, uprev, u, tmp, du2) where {F1
if _chunksize === Val{nothing}()
_chunksize = nothing
end

println("_chunksize = $_chunksize")
jac_config = ForwardColorJacCache(uf, uprev, _chunksize; colorvec = colorvec,
sparsity = sparsity, tag = T)
elseif alg_autodiff(alg) isa AutoFiniteDiff
Expand Down

0 comments on commit 0f3cb76

Please sign in to comment.