Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To run:
# using PkgBenchmark, Enzyme
# result = benchmarkpkg(KernelAbstractions)
# result = benchmarkpkg(Enzyme)
# export_markdown("benchmark/perf.md", result)

# Note: if you change this file you will need to delete an regenerate tune.json
Expand All @@ -13,4 +13,22 @@ const SUITE = BenchmarkGroup()

SUITE["basics"] = BenchmarkGroup()

SUITE["basics"]["overhead"] = @benchmarkable Enzyme.autodiff(Forward, identity, Const(1.0))
SUITE["basics"]["overhead"] = @benchmarkable Enzyme.autodiff(Forward, identity, Const(1.0))

SUITE["basics"]["make_zero"] = BenchmarkGroup()
SUITE["basics"]["remake_zero!"] = BenchmarkGroup()

p = (; x = 1.0, y = zeros(3))

SUITE["basics"]["make_zero"]["namedtuple"] = @benchmarkable Enzyme.make_zero($p)
SUITE["basics"]["remake_zero!"]["namedtuple"] = @benchmarkable Enzyme.remake_zero!(dp) setup = (dp = Enzyme.make_zero(p))

struct MyStruct
x::Float64
y::Vector{Float64}
end

x = MyStruct(1.0, zeros(3))

SUITE["basics"]["make_zero"]["struct"] = @benchmarkable Enzyme.make_zero($x)
SUITE["basics"]["remake_zero!"]["struct"] = @benchmarkable Enzyme.remake_zero!(dx) setup = (dx = Enzyme.make_zero(x))
Loading