Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
change to a floating point number
remove unused variables
  • Loading branch information
haichangsi committed Nov 8, 2023
1 parent 114b32e commit 73214c3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/example5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace mhp = dr::mhp;

using T = uint16_t;
using T = float;
using MDA = dr::mhp::distributed_mdarray<T, 2>;

int main() {
Expand All @@ -29,15 +29,13 @@ int main() {

auto in = dr::mhp::views::submdspan(a.view(), slice_starts, slice_ends);
auto out = dr::mhp::views::submdspan(b.view(), slice_starts, slice_ends);
auto in_array = &a;
auto out_array = &b;

auto mdspan_stencil_op = [](auto &&v) {
auto [in, out] = v;
out(0, 0) = (in(-1, 0) + in(0, -1) + in(0, 0) + in(0, 1) + in(1, 0)) / 4;
};

mhp::halo(*in_array).exchange();
mhp::halo(a).exchange();
mhp::stencil_for_each(mdspan_stencil_op, in, out);

if (mhp::rank() == 0) {
Expand Down

0 comments on commit 73214c3

Please sign in to comment.