axom
axom copied to clipboard
Multimat: update benchmark code
Summary
- Use templates to consolidate direct-access and submap-access microbenchmarks in Multimat
calculate.cpp
example- Adds an enum class
MMFieldMethod
to test different methods of accessing Multimat field data - Adds a
FieldGetter
helper class which is specialized onMMFieldMethod
to encapsulate returning different types of fields - This should resolve some inconsistencies seen in results for direct-access microbenchmarks [*]
- Adds an enum class
- Adds corresponding test result outputs to
Result_Store
helper class; this fixes an issue where the original templated tests would overwrite each other
Removing the other test methods will be deferred for a later PR, since it seems to mess up the diff.
[*] One of the (faster) examples constructed a ProductSet<RangeSet, RangeSet>
to compute the flat index itself, while other methods were calling BivariateMap::findValue(firstIdx, secondIdx)
. It seems the speedup resulted from the use of slam::RangeSet
instead of a slam::Set
to instantiate the ProductSet
.
This change will be made within Multimat itself in #945, but for now we just construct the fully-specified BivariateMap ourselves to have a performance "target" to aim for.
We also standardize on the use of BivariateMap::operator()(firstIdx, secondIdx)
for direct-access, since what we really care about is the performance hit from the abstraction.