Improve ThOr functor testing with different SIMD backends
The main change here is to add a new algorithm for testing compilation and execution of ThOr functors: ThOr::Functors::Tests::{Evaluate,Initialise}<LHCb::Pr::Fitted::Forward::Tracks>
.
This requests (functor cache, JIT) compilation of all supported combinations of different SIMD backends etc. For example:
- JIT/cling scalar (should return
scalar::int_v
,scalar::float_v
,scalar::mask_v
) - JIT/cling scalar POD (should return
int
,float
,bool
) - functor cache scalar (should match JIT/cling)
- functor cache scalar POD (should match JIT/cling)
- functor cache SSE (should return
sse::int_v
,sse::float_v
,sse::mask_v
) - functor cache AVX2 ...
- ...
One variant (...::Initialise<T>
) stops there, the other (...::Evaluate<T>
) also tests that evaluating all of these different versions give compatible results. The latter option only works if there is a source of input data, or if the functors don't take input data (i.e. they are "void"). So far we have a lightweight generator of fake LHCb::Pr::Fitted::Forward::Tracks
, so evaluation of those functors is tested.
Itemised changes:
- Use this new algorithm in a new QMTest
- Remove some old tests that are now more comprehensively tested by the new algorithm
- Improved
with_functors
andwith_functor_maps
mixins, notably they now cope with duplicated property names (so you can configure one property in Python, but have this map onto multiple things in C++ such as different SIMD backends etc.) - Fix a bug in the
COMB
(re-assemble a combination object from a composite object) functor that was caught by improved testing - Improve error message from the ThOr functor factory interface.
- Make SIZE functor cope with being told the explicit type of its target container.
- Use
ThOr::Defaults::ALL
shorthand in a couple more places - Add
pack_dict
helper functor toFunctors.utils
. This is useful when packing a Python dictionary of functors into the property created by thewith_functor_maps
mixin. This replaces a Python snippet that had already been copied/pasted to a bunch of different places... - Add an
Sel::Utils::as_arithmetic( SIMDWrapper::scalar::mask_v )
overload - Take advantage of the improvements to
with_functors
above to remove duplicated (VertexCut
/VertexCutSIMD
) properties in CombineTracksSIMD - Improve an error message in
CombineTracksSIMD
- Tweak Python-side ThOr functors:
- Support passing a (c++ type string, header) pair as a template argument to functors with the default parser.
- Make Python-side ThOr functors know their 'pretty' name (e.g.
RUNNUMBER
) as well as their 'pretty' expression (e.g.RUNNUMBER(ODIN=....)
). - Make ThOr functors print their more succinct versions (in some circumstances..)
- Add a somewhat hacky comparison operator to BoundFunctor so that printing Python configurables with ThOr functor properties works.
Should be tested with LHCb!2661 (merged) and Moore!577 (merged).