mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-04-19 22:38:52 +00:00
Criterion registration macro
This commit is contained in:
@@ -65,8 +65,7 @@ public:
|
||||
};
|
||||
|
||||
// Register the criterion with NVBench:
|
||||
static nvbench::stopping_criterion& criterion_ref = //
|
||||
nvbench::criterion_manager::get().add(std::make_unique<fixed_criterion>());
|
||||
NVBENCH_REGISTER_CRITERION(fixed_criterion);
|
||||
|
||||
void throughput_bench(nvbench::state &state)
|
||||
{
|
||||
|
||||
@@ -51,4 +51,13 @@ public:
|
||||
static nvbench::stopping_criterion::params_description get_params_description();
|
||||
};
|
||||
|
||||
/**
|
||||
* Given a stopping criterion type `TYPE`, registers it in the criterion manager
|
||||
*
|
||||
* See the `custom_criterion.cu` example for usage.
|
||||
*/
|
||||
#define NVBENCH_REGISTER_CRITERION(TYPE) \
|
||||
static nvbench::stopping_criterion& NVBENCH_UNIQUE_IDENTIFIER(TYPE) = \
|
||||
nvbench::criterion_manager::get().add(std::make_unique<TYPE>()) \
|
||||
|
||||
} // namespace nvbench
|
||||
|
||||
Reference in New Issue
Block a user