mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-04-20 14:58:54 +00:00
Simplified user iterators
This commit is contained in:
@@ -116,18 +116,14 @@ struct under_diag final : nvbench::user_axis_space
|
||||
// our update function
|
||||
auto diag_under =
|
||||
[&, info](std::size_t,
|
||||
std::vector<nvbench::detail::axis_index> &indices) {
|
||||
nvbench::detail::axis_index temp = info[0];
|
||||
temp.index = x_pos;
|
||||
indices.push_back(std::move(temp));
|
||||
|
||||
temp = info[1];
|
||||
temp.index = y_pos;
|
||||
indices.push_back(std::move(temp));
|
||||
std::vector<nvbench::detail::axis_index>::iterator start,
|
||||
std::vector<nvbench::detail::axis_index>::iterator end) {
|
||||
start->index = x_pos;
|
||||
end->index = y_pos;
|
||||
};
|
||||
|
||||
const size_t iteration_length = ((info[0].size * (info[1].size + 1)) / 2);
|
||||
return nvbench::detail::axis_space_iterator(2,
|
||||
return nvbench::detail::axis_space_iterator(info,
|
||||
iteration_length,
|
||||
adv_func,
|
||||
diag_under);
|
||||
@@ -188,14 +184,14 @@ struct gauss final : nvbench::user_axis_space
|
||||
}
|
||||
|
||||
// our update function
|
||||
auto gauss_func = [=](std::size_t index,
|
||||
std::vector<nvbench::detail::axis_index> &indices) {
|
||||
nvbench::detail::axis_index temp = info[0];
|
||||
temp.index = gauss_indices[index];
|
||||
indices.push_back(std::move(temp));
|
||||
};
|
||||
auto gauss_func =
|
||||
[=](std::size_t index,
|
||||
std::vector<nvbench::detail::axis_index>::iterator start,
|
||||
std::vector<nvbench::detail::axis_index>::iterator) {
|
||||
start->index = gauss_indices[index];
|
||||
};
|
||||
|
||||
return nvbench::detail::axis_space_iterator(1,
|
||||
return nvbench::detail::axis_space_iterator(info,
|
||||
iteration_length,
|
||||
gauss_func);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user