Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_task.hh
| Show All 31 Lines | |||||
| #include "BLI_index_range.hh" | #include "BLI_index_range.hh" | ||||
| #include "BLI_lazy_threading.hh" | #include "BLI_lazy_threading.hh" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| namespace blender::threading { | namespace blender::threading { | ||||
| template<typename Range, typename Function> | template<typename Range, typename Function> | ||||
| void parallel_for_each(Range &range, const Function &function) | void parallel_for_each(Range &&range, const Function &function) | ||||
| { | { | ||||
| #ifdef WITH_TBB | #ifdef WITH_TBB | ||||
| tbb::parallel_for_each(range, function); | tbb::parallel_for_each(range, function); | ||||
| #else | #else | ||||
| for (auto &value : range) { | for (auto &value : range) { | ||||
| function(value); | function(value); | ||||
| } | } | ||||
| #endif | #endif | ||||
| ▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines | |||||