From 0f3cb765ff1aa329108bc735302b90b9cd4de871 Mon Sep 17 00:00:00 2001 From: jClugstor Date: Tue, 12 Nov 2024 15:36:30 -0500 Subject: [PATCH] change back to checking for Val(0) --- lib/OrdinaryDiffEqCore/src/alg_utils.jl | 4 ++-- lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/OrdinaryDiffEqCore/src/alg_utils.jl b/lib/OrdinaryDiffEqCore/src/alg_utils.jl index 048bd46b01..99715e0c27 100644 --- a/lib/OrdinaryDiffEqCore/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqCore/src/alg_utils.jl @@ -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 diff --git a/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl b/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl index f05b05cdb4..d5c4872997 100644 --- a/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl +++ b/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl @@ -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 @@ -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