Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void bulk_function(hpx::lcos::spmd_block block,
- hpx::partitioned_vector<double> data,
- size_t global_nx,
- size_t global_ny,
- size_t ngc) {
- using view_2d = hpx::partitioned_vector_view<double,2>;
- //pad with barriers (ngc on both ends)
- std::size_t NX = global_nx + 2*ngc;
- std::size_t NY = global_ny + 2*ngc;
- view_2d v2d(block, data.begin(), data.end(), {NX, NY});
- view_2d subview(block,&v2d(0,0),&v2d(3,3),{3,3},{NX,NY});
- if (block.this_image() == 0) {
- /*
- error: no match for ‘operator=’ (operand types are
- ‘hpx::detail::view_element<double, std::vector<double> >’ and ‘double’)
- */
- v2d(0,0) = double(43.0); //this doesnt compile
- //subview(0,0) = double(3.0); //this doesnt compile
- //subview(0,0) = std::vector<double>{3.0, 1.0}; //this compiles
- }
- block.sync_all();
- }
- HPX_PLAIN_ACTION(bulk_function, bulk_action);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement