Skip to content

Commit 943fd30

Browse files
Set strict=false for DI in HomotopyContinuation
```julia /home/runner/work/NonlinearSolve.jl/NonlinearSolve.jl/lib/NonlinearSolveHomotopyContinuation/test/single_root.jl:151 Got exception outside of a @test PreparationMismatchError (inconsistent types between preparation and execution): - f!: ✅ - y: ✅ - backend: ✅ - x: ❌ - prep: Vector{Float64} - exec: Base.ReinterpretArray{Float64, 1, ComplexF64, Vector{ComplexF64}, false} - contexts: ✅ If you are confident that this check is superfluous, you can disable it by running preparation with the keyword argument `strict=Val(false)` inside DifferentiationInterface. ``` Reinterpret seems to bug it so it's easiest to just remove it.
1 parent f924404 commit 943fd30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/NonlinearSolveHomotopyContinuation/src/jacobian_handling.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ function construct_jacobian(f, autodiff, variant, u0, p)
118118
end
119119
f = ComplexJacobianWrapper{variant}(f)
120120
if variant == OutOfPlace
121-
prep = DI.prepare_jacobian(f, autodiff, tmp, DI.Constant(p))
121+
prep = DI.prepare_jacobian(f, autodiff, tmp, DI.Constant(p), strict = Val(false))
122122
else
123-
prep = DI.prepare_jacobian(f, tmp, autodiff, copy(tmp), DI.Constant(p))
123+
prep = DI.prepare_jacobian(f, tmp, autodiff, copy(tmp), DI.Constant(p), strict = Val(false))
124124
end
125125

126126
if variant == Scalar
@@ -182,13 +182,13 @@ Construct an `EnzymeJacobian` function.
182182
"""
183183
function construct_jacobian(f, autodiff::AutoEnzyme, variant, u0, p)
184184
if variant == Scalar
185-
prep = DI.prepare_derivative(f, autodiff, u0, DI.Constant(p))
185+
prep = DI.prepare_derivative(f, autodiff, u0, DI.Constant(p), strict = Val(false))
186186
else
187187
tmp = Vector{ComplexF64}(undef, length(u0))
188188
if variant == Inplace
189-
prep = DI.prepare_jacobian(f, tmp, autodiff, copy(tmp), DI.Constant(p))
189+
prep = DI.prepare_jacobian(f, tmp, autodiff, copy(tmp), DI.Constant(p), strict = Val(false))
190190
else
191-
prep = DI.prepare_jacobian(f, autodiff, tmp, DI.Constant(p))
191+
prep = DI.prepare_jacobian(f, autodiff, tmp, DI.Constant(p), strict = Val(false))
192192
end
193193
end
194194
return EnzymeJacobian{variant}(f, prep, autodiff)

0 commit comments

Comments
 (0)