Skip to content

Commit

Permalink
Add function filter to type stability checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle committed Oct 10, 2024
1 parent 420012f commit 4ca7fa1
Show file tree
Hide file tree
Showing 2 changed files with 207 additions and 161 deletions.
9 changes: 8 additions & 1 deletion DifferentiationInterfaceTest/src/test_differentiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ For `type_stability` and `benchmark`, the possible values are `:none`, `:prepare
**Type stability options:**
- `ignored_modules=nothing`: list of modules that JET.jl should ignore
- `function_filter`: filter for functions that JET.jl should ignore (with a reasonable default)
**Benchmark options:**
Expand All @@ -72,6 +73,11 @@ function test_differentiation(
sparsity::Bool=true,
# type stability options
ignored_modules=nothing,
function_filter=if VERSION >= v"1.11"
@nospecialize(f) -> true
else
@nospecialize(f) -> f != Base.mapreduce_empty # fix for `mapreduce` in jacobian and hessian
end,
# benchmark options
count_calls::Bool=true,
)
Expand Down Expand Up @@ -136,7 +142,8 @@ function test_differentiation(
adapted_backend,
scen;
subset=type_stability,
ignored_modules=ignored_modules,
ignored_modules,
function_filter,
)
end
yield()
Expand Down
Loading

0 comments on commit 4ca7fa1

Please sign in to comment.