bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
parallel.h File Reference
#include "bitsim/bitsim_types.h"
#include "bitsim/utils/concurrency/thread_pool.h"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <exception>
#include <future>
#include <optional>
#include <type_traits>
#include <vector>
Include dependency graph for parallel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  bitsim
namespace  bitsim::utils
namespace  bitsim::utils::concurrency

Functions

template<typename Index, typename F>
void bitsim::utils::concurrency::parallel_for (Index begin, Index end, F &&f, ThreadPool &pool=default_thread_pool(), Index grain=1)
 Call f(i) for every i in [begin, end), spread over the threads of pool.
template<typename F>
auto bitsim::utils::concurrency::parallel_map (std::size_t n, F &&f, ThreadPool &pool=default_thread_pool()) -> std::vector< std::invoke_result_t< F &, std::size_t > >
 Compute f(0), f(1), ..., f(n - 1) on the threads of pool.
uint_t bitsim::utils::concurrency::task_seed (uint_t base_seed, uint_t task) noexcept
 A seed for task task, made from base_seed.