invoke_impl.h 848 Bytes
Newer Older
1 2 3 4 5 6

#ifndef PLS_INVOKE_PARALLEL_IMPL_H
#define PLS_INVOKE_PARALLEL_IMPL_H

#include "pls/internal/scheduling/scheduler.h"

7
namespace pls::algorithm {
8

9
template<typename Function1, typename Function2>
10
void invoke(Function1 &&function1, Function2 &&function2) {
11
  using namespace ::pls::internal::scheduling;
12

13
  scheduler::spawn(std::forward<Function1>(function1));
14
  scheduler::spawn_and_sync(std::forward<Function2>(function2));
15
}
16

17
template<typename Function1, typename Function2, typename Function3>
18
void invoke(Function1 &&function1, Function2 &&function2, Function3 &&function3) {
19
  using namespace ::pls::internal::scheduling;
20

21 22
  scheduler::spawn(std::forward<Function1>(function1));
  scheduler::spawn(std::forward<Function2>(function2));
23
  scheduler::spawn_and_sync(std::forward<Function3>(function3));
24 25 26
}

}
27 28

#endif //PLS_INVOKE_PARALLEL_IMPL_H