Skip to content

Commit

Permalink
fix backend benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGrulich committed Sep 30, 2024
1 parent 3c8cd65 commit 8f55da9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nautilus/test/benchmark/TracingBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,19 @@ TEST_CASE("Backend Compilation Benchmark") {
auto func = std::get<1>(test);
auto name = std::get<0>(test);

Catch::Benchmark::Benchmark("comp_" + backend + "_" + name).operator=([&func, &registry](Catch::Benchmark::Chronometer meter) {
Catch::Benchmark::Benchmark("comp_" + backend + "_" + name).operator=([&func, &registry, backend](Catch::Benchmark::Chronometer meter) {
std::shared_ptr<tracing::ExecutionTrace> trace = tracing::TraceContext::trace(func);
auto ssaCreationPhase = tracing::SSACreationPhase();
trace = ssaCreationPhase.apply(trace);
auto backend = registry.getBackend("mlir");
auto backendBackend = registry.getBackend("mlir");
auto irConversionPhase = tracing::TraceToIRConversionPhase();
auto ir = irConversionPhase.apply(trace);
auto op = engine::Options();
// force compilation for the MLIR backend.
op.setOption("mlir.eager_compilation", true);
op.setOption("engine.backend", backend);
auto dh = compiler::DumpHandler(op, "");
meter.measure([&] { return backend->compile(ir, dh, op); });
meter.measure([&] { return backendBackend->compile(ir, dh, op); });
});
}
}
Expand Down

0 comments on commit 8f55da9

Please sign in to comment.