Only trigger skipping of outstanding benchmarks on KeyboardInterrupt exception, on others benchmakr is to continue execution

This commit is contained in:
Oleksandr Pavlyk
2025-12-08 14:46:59 -06:00
parent 7e9a9a8983
commit f6a9b245d3

View File

@@ -99,7 +99,16 @@ struct benchmark_wrapper_t
}
catch (const py::error_already_set &e)
{
throw nvbench::stop_runner_loop(e.what());
if (e.matches(PyExc_KeyboardInterrupt))
{
// interrupt execution of outstanding instances
throw nvbench::stop_runner_loop(e.what());
}
else
{
// re-raise
throw;
}
}
}