Template Struct dispatch_set

Nested Relationships

Nested Types

Struct Documentation

template<typename ValueType, typename ...Tuples>
struct dispatch_set

Exact set of allowed tuples for sparse dispatch.

Where a tuple of dispatch_params probes the full cartesian product, dispatch_set enumerates only the combinations that exist:

using Shapes = poet::dispatch_set<int, poet::tuple_<2, 2>, poet::tuple_<4, 4>>;
poet::dispatch(MatMul{}, Shapes{rows, cols}, a, b, c);

Note

Unlike the dispatch_param overloads, this path calls only the template form functor.template operator()<Values...>(args...). A functor taking std::integral_constant parameters will not compile here.

Template Parameters:
  • ValueType – Type every tuple element is converted to.

  • Tuples – The allowed combinations, as tuple_<...>. All must have the same arity and be distinct.

Public Types

using seq_type = std::tuple<typename convert_tuple<Tuples>::type...>

The allowed tuples as std::integer_sequences; what dispatch matches against.

Public Functions

template<typename ...Args, typename = std::enable_if_t<sizeof...(Args) == tuple_arity>>
inline explicit dispatch_set(Args&&... args)

Binds the runtime values to probe. Requires exactly tuple_arity of them.

inline auto runtime_tuple() const

Public Static Attributes

static constexpr std::size_t tuple_arity = detail::sequence_size<std::tuple_element_t<0, seq_type>>::value

Number of values in every allowed tuple.