Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <hpx/hpx_main.hpp>
- #include <hpx/include/iostreams.hpp>
- #include <hpx/parallel/algorithms/for_loop.hpp>
- class ParallelLoopBody
- {
- public:
- virtual ~ParallelLoopBody();
- virtual void operator() (const int& n) const = 0;
- };
- class ParallelLoopBodyWrapper : public ParallelLoopBody
- {
- public:
- // ParallelLoopBodyWrapper() {};
- ~ParallelLoopBodyWrapper(){};
- void operator()(const int& n) const{
- hpx::cout << "PLBW!" << std::endl;
- }
- };
- int main()
- {
- // Say hello to the world!
- hpx::cout << "Hello World!\n" << hpx::flush;
- hpx::parallel::for_loop_strided(
- hpx::parallel::execution::par, 0, 10, 1,
- [&](std::size_t i) {
- hpx::cout << "i = " << i << std::endl;
- });
- ParallelLoopBody *PLBW_ptr = new ParallelLoopBodyWrapper();
- // Executes operator() from PLBW
- // hpx::parallel::for_loop_strided(
- // hpx::parallel::execution::par, 0, 500, 1,
- // ?WHAT_HERE?);
- return 0;
- }
- //]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement