Skip to content

Commit b14675e

Browse files
Use DEFAULT_SPECIALIZATION for NonlinearFunction constructors
Change NonlinearFunction constructors to use DEFAULT_SPECIALIZATION (which defaults to AutoSpecialize via Preferences) instead of hardcoded FullSpecialize. This matches the intended behavior where AutoSpecialize is the default specialization level. When NonlinearSolve.jl reads the AutoSpecialize trait, it wraps the function in FunctionWrappers to eliminate per-function recompilation. Without NonlinearSolve.jl#838, AutoSpecialize is a no-op (the trait is stored but never read), so this change is backwards compatible. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e7e9915 commit b14675e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/scimlfunctions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4480,11 +4480,11 @@ function NonlinearFunction{iip, specialize}(
44804480
end
44814481

44824482
function NonlinearFunction{iip}(f; kwargs...) where {iip}
4483-
return NonlinearFunction{iip, FullSpecialize}(f; kwargs...)
4483+
return NonlinearFunction{iip, DEFAULT_SPECIALIZATION}(f; kwargs...)
44844484
end
44854485
NonlinearFunction{iip}(f::NonlinearFunction; kwargs...) where {iip} = f
44864486
function NonlinearFunction(f; kwargs...)
4487-
return NonlinearFunction{isinplace(f, 3), FullSpecialize}(f; kwargs...)
4487+
return NonlinearFunction{isinplace(f, 3), DEFAULT_SPECIALIZATION}(f; kwargs...)
44884488
end
44894489
NonlinearFunction(f::NonlinearFunction; kwargs...) = f
44904490

0 commit comments

Comments
 (0)