Skip to content

Commit

Permalink
Unconditional lookup in neighbor table
Browse files Browse the repository at this point in the history
  • Loading branch information
fthaler committed Sep 25, 2024
1 parent a83027f commit c896ea1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/gridtools/fn/unstructured.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ namespace gridtools::fn {
template <class Tag, class Ptr, class Strides, class Domain, class Conn, class Offset>
GT_FUNCTION constexpr auto horizontal_shift(iterator<Tag, Ptr, Strides, Domain> const &it, Conn, Offset) {
auto const &table = host_device::at_key<Conn>(it.m_domain.m_tables);
auto new_index = it.m_index == -1 ? -1 : get<Offset::value>(neighbor_table::neighbors(table, it.m_index));
auto new_index = get<Offset::value>(neighbor_table::neighbors(table, std::max(it.m_index, 0)));
auto shifted = it;
shifted.m_index = new_index;
shifted.m_index = it.m_index == -1 ? -1 : new_index;
return shifted;
}

Expand Down

0 comments on commit c896ea1

Please sign in to comment.