Commit 92b16926 authored by Arthur Marius Hennequin's avatar Arthur Marius Hennequin
Browse files

Use mask in gather proxy behaviour

parent c91a6ed0
Pipeline #3289665 passed with stages
in 22 seconds
...@@ -690,7 +690,7 @@ namespace ThOr { ...@@ -690,7 +690,7 @@ namespace ThOr {
auto const fit_success_mask = m_vertex_fitter.fitComposite( auto const fit_success_mask = m_vertex_fitter.fitComposite(
tmp_storage, mask, new_composite_pids, tmp_storage, mask, new_composite_pids,
Sel::ParticleCombination{detail::Combiner::invoke_or_visit_returning_variant( Sel::ParticleCombination{detail::Combiner::invoke_or_visit_returning_variant(
[&]( auto const& container ) { return container.gather( indices[IInput] ); }, [&]( auto const& container ) { return container.gather( indices[IInput], mask ); },
std::get<IInput>( in ) )...} ); std::get<IInput>( in ) )...} );
if ( tmp_storage.size() != simd_t::size ) { if ( tmp_storage.size() != simd_t::size ) {
throw exception( "tmp_storage didn't have simd_t::size elements." ); throw exception( "tmp_storage didn't have simd_t::size elements." );
...@@ -840,9 +840,10 @@ namespace ThOr { ...@@ -840,9 +840,10 @@ namespace ThOr {
auto const particles1_mask = simd_t::loop_mask( i1, indices1.size() ); auto const particles1_mask = simd_t::loop_mask( i1, indices1.size() );
// Note that this is only *not* reading from beyond the end of // Note that this is only *not* reading from beyond the end of
// indices1 because of the convoluted .resize() in get_indices() // indices1 because of the convoluted .resize() in get_indices()
auto const p1_inds = select( particles1_mask, int_v{std::next( indices1.data(), i1 )}, int_v{indices1[i1]} ); auto const p1_inds = int_v{std::next( indices1.data(), i1 )};
auto const particles1 = detail::Combiner::invoke_or_visit_returning_variant( auto const particles1 = detail::Combiner::invoke_or_visit_returning_variant(
[&]( auto const& container ) { return container.gather( p1_inds ); }, std::get<1>( in ) ); [&]( auto const& container ) { return container.gather( p1_inds, particles1_mask ); },
std::get<1>( in ) );
// The "triangle" inefficiency comes in from the `loop_mask`: // The "triangle" inefficiency comes in from the `loop_mask`:
// d // d
// c d // c d
...@@ -1026,7 +1027,7 @@ namespace ThOr { ...@@ -1026,7 +1027,7 @@ namespace ThOr {
// one // one
new_comb_t const comb{ new_comb_t const comb{
detail::Combiner::invoke_or_visit_returning_variant( detail::Combiner::invoke_or_visit_returning_variant(
[inds = indices[Particle]]( auto const& container ) { return container.gather( inds ); }, [inds = indices[Particle], mask]( auto const& container ) { return container.gather( inds, mask ); },
std::get<Particle>( in ) )..., std::get<Particle>( in ) )...,
detail::Combiner::invoke_or_visit_returning_variant( detail::Combiner::invoke_or_visit_returning_variant(
[&]( auto const& container ) { return container.scalar_fill( new_indices[i] ); }, [&]( auto const& container ) { return container.scalar_fill( new_indices[i] ); },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment