Skip to content

Commit

Permalink
cleanup einsum_tot/ijk_mn_eq_ij_mn_times_kj_mn .. no need for such ve…
Browse files Browse the repository at this point in the history
…rbose element access @bimalgaudel
  • Loading branch information
evaleev committed Jan 10, 2024
1 parent e71ceed commit 7b2e6c6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/einsum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,16 +633,14 @@ BOOST_AUTO_TEST_CASE(ijk_mn_eq_ij_mn_times_kj_mn) {
using Ix2 = std::array<decltype(i), 2>;
using Ix3 = std::array<decltype(i), 3>;

auto lhs_tile_ix = lhs.trange().element_to_tile(Ix2{i, j});
auto lhs_tile_ix = lhs.trange().element_to_tile({i, j});
auto lhs_tile = lhs.find_local(lhs_tile_ix).get(/* dowork = */ false);
auto rhs_tile_ix = rhs.trange().element_to_tile(Ix2{k, j});
auto rhs_tile_ix = rhs.trange().element_to_tile({k, j});
auto rhs_tile = rhs.find_local(rhs_tile_ix).get(/* dowork = */ false);

auto& res_el =
result_tile.at_ordinal(result_tile.range().ordinal(Ix3{i, j, k}));
auto const& lhs_el =
lhs_tile.at_ordinal(lhs_tile.range().ordinal(Ix2{i, j}));
auto rhs_el = rhs_tile.at_ordinal(rhs_tile.range().ordinal(Ix2{k, j}));
auto& res_el = result_tile({i, j, k});
auto const& lhs_el = lhs_tile({i, j});
auto rhs_el = rhs_tile({k, j});
res_el = lhs_el.mult(rhs_el); // m,n * m,n -> m,n
}
return result_tile;
Expand Down

0 comments on commit 7b2e6c6

Please sign in to comment.