dispenso 1.4.1
A library for task parallelism
Loading...
Searching...
No Matches
Parallel Loops

Parallel for loops and iteration. More...

Files

file  for_each.h
 
file  parallel_for.h
 

Detailed Description

Parallel for loops and iteration.

Functions for performing parallel for loops and parallel iteration over ranges. These provide simple, high-level APIs for data-parallel operations.

Example: Basic parallel_for

std::vector<float> data(1000);
// Process elements in parallel
dispenso::parallel_for(0, data.size(), [&](size_t i) {
data[i] = std::sin(static_cast<float>(i));
});

Example: Parallel for_each

std::vector<int> values = {1, 2, 3, 4, 5};
dispenso::for_each(values.begin(), values.end(), [](int& v) {
v *= 2; // Double each value in parallel
});