diff --git a/nvbench/state.cuh b/nvbench/state.cuh index 9a8d915..61fd840 100644 --- a/nvbench/state.cuh +++ b/nvbench/state.cuh @@ -151,10 +151,7 @@ struct state /// Control the stopping criterion for the measurement loop. /// @{ [[nodiscard]] const std::string &get_stopping_criterion() const { return m_stopping_criterion; } - void set_stopping_criterion(std::string criterion) - { - m_stopping_criterion = std::move(criterion); - } + void set_stopping_criterion(std::string criterion); /// @} /// If true, the benchmark is only run once, skipping all warmup runs and only diff --git a/nvbench/state.cxx b/nvbench/state.cxx index d29d40b..9d52667 100644 --- a/nvbench/state.cxx +++ b/nvbench/state.cxx @@ -16,6 +16,7 @@ * limitations under the License. */ #include +#include #include #include #include @@ -300,4 +301,10 @@ void state::add_buffer_size(std::size_t num_bytes, } } +void state::set_stopping_criterion(std::string criterion) +{ + m_stopping_criterion = std::move(criterion); + m_criterion_params = criterion_manager::get().get_criterion(m_stopping_criterion).get_params(); +} + } // namespace nvbench