Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix name resolution for shift #1732

Merged
merged 2 commits into from
Nov 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions include/gridtools/fn/unstructured.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,20 @@ namespace gridtools::fn {
return shifted;
}

template <class Tag, class Ptr, class Strides, class Domain>
GT_FUNCTION constexpr auto shift(iterator<Tag, Ptr, Strides, Domain> const &it) {
return it;
}

template <class Tag, class Ptr, class Strides, class Domain, class Dim, class Offset, class... Offsets>
GT_FUNCTION constexpr auto shift(
iterator<Tag, Ptr, Strides, Domain> const &it, Dim, Offset offset, Offsets... offsets) {
if constexpr (has_key<decltype(it.m_domain.m_tables), Dim>()) {
return shift(horizontal_shift(it, Dim(), offset), offsets...);
return unstructured_impl_::shift(horizontal_shift(it, Dim(), offset), offsets...);
} else {
return shift(non_horizontal_shift(it, Dim(), offset), offsets...);
return unstructured_impl_::shift(non_horizontal_shift(it, Dim(), offset), offsets...);
}
}
template <class Tag, class Ptr, class Strides, class Domain>
GT_FUNCTION constexpr auto shift(iterator<Tag, Ptr, Strides, Domain> const &it) {
return it;
}

template <class Domain>
struct make_iterator {
Expand Down