The number of agents required is the minimum of `shape_` and the available parallelism. That is, we don't need an agent for each of the shape values.
| 1434 | //! The number of agents required is the minimum of `shape_` and the available parallelism. |
| 1435 | //! That is, we don't need an agent for each of the shape values. |
| 1436 | [[nodiscard]] |
| 1437 | auto num_agents_required() const noexcept -> std::uint32_t |
| 1438 | { |
| 1439 | if constexpr (Parallelize) |
| 1440 | { |
| 1441 | return static_cast<std::uint32_t>( |
| 1442 | __umin({std::size_t(shape_), std::size_t(pool_.available_parallelism())})); |
| 1443 | } |
| 1444 | else |
| 1445 | { |
| 1446 | return static_cast<std::uint32_t>(1); |
| 1447 | } |
| 1448 | } |
| 1449 | |
| 1450 | template <class F> |
| 1451 | void apply(F f) |
no test coverage detected