diff --git a/AUTHORS b/AUTHORS index ec3f45d3d..5474ca65c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,3 +17,4 @@ Mikael Simberg (msimberg), ETH Zurich (CSCS) Till Ehrengruber (tehrengruber), ETH Zurich (CSCS) Péter Kardos (petiaccja), ETH Zurich (EXCLAIM) Stefano Ubbiali (stubbiali), ETH Zurich +Ioannis Magkanaris (iomaganaris), ETH Zurich (CSCS) diff --git a/include/gridtools/fn/unstructured.hpp b/include/gridtools/fn/unstructured.hpp index 136930c19..d80eefab2 100644 --- a/include/gridtools/fn/unstructured.hpp +++ b/include/gridtools/fn/unstructured.hpp @@ -84,7 +84,8 @@ namespace gridtools::fn { template GT_FUNCTION constexpr auto horizontal_shift(iterator const &it, Conn, Offset) { auto const &table = host_device::at_key(it.m_domain.m_tables); - auto new_index = it.m_index == -1 ? -1 : get(neighbor_table::neighbors(table, it.m_index)); + const auto neighbor = get(neighbor_table::neighbors(table, it.m_index)); + const auto new_index = it.m_index == -1 ? -1 : neighbor; auto shifted = it; shifted.m_index = new_index; return shifted;