Skip to content

Commit

Permalink
Replace benchs by benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau committed Jan 13, 2025
1 parent bf00e01 commit 01584e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

[default.extend-words]
# Don't correct these word (parts)
benchs = "benchs"
iy = "iy"
ND = "ND"
30 changes: 15 additions & 15 deletions benchmarks/splines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,35 +232,35 @@ void characteristics_advection(benchmark::State& state)
long const dev = 1;
long const uniform = 0;
long const non_uniform = 1;
// Preallocate 12 unitary benchs for each combination of cpu/gpu execution space, uniform/non-uniform and spline degree we may want to benchmark (those are determined at compile-time, that's why we need to build explicitly 12 variants of the bench even if we call only one of them)
std::map<std::array<long, 3>, std::function<void(benchmark::State&)>> benchs;
benchs[std::array {host, uniform, 3L}]
// Preallocate 12 unitary benchmarks for each combination of cpu/gpu execution space, uniform/non-uniform and spline degree we may want to benchmark (those are determined at compile-time, that's why we need to build explicitly 12 variants of the bench even if we call only one of them)
std::map<std::array<long, 3>, std::function<void(benchmark::State&)>> benchmarks;
benchmarks[std::array {host, uniform, 3L}]
= characteristics_advection_unitary<Kokkos::DefaultHostExecutionSpace, false, 3>;
benchs[std::array {host, uniform, 4L}]
benchmarks[std::array {host, uniform, 4L}]
= characteristics_advection_unitary<Kokkos::DefaultHostExecutionSpace, false, 4>;
benchs[std::array {host, uniform, 5L}]
benchmarks[std::array {host, uniform, 5L}]
= characteristics_advection_unitary<Kokkos::DefaultHostExecutionSpace, false, 5>;
benchs[std::array {host, non_uniform, 3L}]
benchmarks[std::array {host, non_uniform, 3L}]
= characteristics_advection_unitary<Kokkos::DefaultHostExecutionSpace, true, 3>;
benchs[std::array {host, non_uniform, 4L}]
benchmarks[std::array {host, non_uniform, 4L}]
= characteristics_advection_unitary<Kokkos::DefaultHostExecutionSpace, true, 4>;
benchs[std::array {host, non_uniform, 5L}]
benchmarks[std::array {host, non_uniform, 5L}]
= characteristics_advection_unitary<Kokkos::DefaultHostExecutionSpace, true, 5>;
benchs[std::array {dev, uniform, 3L}]
benchmarks[std::array {dev, uniform, 3L}]
= characteristics_advection_unitary<Kokkos::DefaultExecutionSpace, false, 3>;
benchs[std::array {dev, uniform, 4L}]
benchmarks[std::array {dev, uniform, 4L}]
= characteristics_advection_unitary<Kokkos::DefaultExecutionSpace, false, 4>;
benchs[std::array {dev, uniform, 5L}]
benchmarks[std::array {dev, uniform, 5L}]
= characteristics_advection_unitary<Kokkos::DefaultExecutionSpace, false, 5>;
benchs[std::array {dev, non_uniform, 3L}]
benchmarks[std::array {dev, non_uniform, 3L}]
= characteristics_advection_unitary<Kokkos::DefaultExecutionSpace, true, 3>;
benchs[std::array {dev, non_uniform, 4L}]
benchmarks[std::array {dev, non_uniform, 4L}]
= characteristics_advection_unitary<Kokkos::DefaultExecutionSpace, true, 4>;
benchs[std::array {dev, non_uniform, 5L}]
benchmarks[std::array {dev, non_uniform, 5L}]
= characteristics_advection_unitary<Kokkos::DefaultExecutionSpace, true, 5>;

// Run the desired bench
benchs.at(std::array {state.range(0), state.range(1), state.range(2)})(state);
benchmarks.at(std::array {state.range(0), state.range(1), state.range(2)})(state);
}

} // namespace DDC_HIP_5_7_ANONYMOUS_NAMESPACE_WORKAROUND(SPLINES_CPP)
Expand Down

0 comments on commit 01584e9

Please sign in to comment.