MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / parallel_loop_container

Function parallel_loop_container

include/Helpers/Parallel.hpp:26–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#endif
25
26template <typename ContainerType> void parallel_loop_container(const ContainerType& c, std::function<void(const typename ContainerType::value_type&)> func, bool forceSingleThread = false) {
27#if defined(__EMSCRIPTEN__) || defined(__ANDROID__)
28 std::for_each(c.begin(), c.end(), func);
29#else
30 if(forceSingleThread)
31 std::for_each(c.begin(), c.end(), func);
32 else
33 std::for_each(std::execution::par_unseq, c.begin(), c.end(), func);
34#endif
35}
36
37template <typename ContainerType> void parallel_loop_container_mutable(ContainerType& c, std::function<void(typename ContainerType::value_type&)> func, bool forceSingleThread = false) {
38#if defined(__EMSCRIPTEN__) || defined(__ANDROID__)

Callers 4

paste_clipboardMethod · 0.85
load_fileMethod · 0.85

Calls 3

for_eachFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected