-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathbenchmark.jl
More file actions
32 lines (29 loc) · 956 Bytes
/
benchmark.jl
File metadata and controls
32 lines (29 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Pkg
using ADTypes: ADTypes
using DataFrames: DataFrame
using DifferentiationInterface, DifferentiationInterfaceTest
import DifferentiationInterface as DI
import DifferentiationInterfaceTest as DIT
using FiniteDiff: FiniteDiff
using Test
import Chairmarks
@testset "Benchmarking sparse" begin
filtered_sparse_scenarios = filter(sparse_scenarios(; band_sizes = [])) do scen
DIT.function_place(scen) == :in &&
DIT.operator_place(scen) == :in &&
scen.x isa AbstractVector &&
scen.y isa AbstractVector
end
data = benchmark_differentiation(
MyAutoSparse(AutoFiniteDiff()),
filtered_sparse_scenarios;
benchmark = :prepared,
excluded = SECOND_ORDER,
logging = LOGGING,
) |> DataFrame
@testset "Analyzing benchmark results" begin
@testset "$(row[:scenario])" for row in eachrow(data)
@test row[:allocs] == 0
end
end
end