Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
dispatch_count.hpp File Reference

Turn a run-time count into a compile-time one. More...

#include <cstddef>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Namespaces

namespace  pulp
namespace  pulp::runtime

Functions

template<std::size_t Max, typename Fn>
constexpr bool pulp::runtime::dispatch_count (std::size_t n, Fn &&fn)
 Call fn(std::integral_constant<std::size_t, n>{}) for a run-time n in [1, Max], so a kernel can be instantiated per count (fixed-size local arrays, fully unrolled inner loops) and selected at run time without a hand-written switch.

Detailed Description

Turn a run-time count into a compile-time one.