10 void par_for(
const int size,
const std::function<
void(
int,
int,
int)> &func)
12#ifdef POLYFEM_WITH_CPP_THREADS
18 std::vector<std::thread> threads(n_threads);
20 for (
int t = 0; t < n_threads; t++)
22 threads[t] = std::thread(std::bind(
25 (t + 1) == n_threads ? size : (t + 1) * size / n_threads,
28 std::for_each(threads.begin(), threads.end(), [](std::thread &
x) { x.join(); });