MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / num_agents_required

Function num_agents_required

include/exec/static_thread_pool.hpp:1436–1448  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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)

Callers 2

bulk_shared_stateMethod · 0.85
_bulk_shared_stateFunction · 0.85

Calls 2

__uminFunction · 0.85
available_parallelismMethod · 0.45

Tested by

no test coverage detected