Conversation
Yurlungur
left a comment
There was a problem hiding this comment.
LGTM! Would it be possible to unify the index access methods with something like this? Or would that be ambiguous with the other definitions?
template <class TIn, typename... Args, REQUIRES(sizeof...(Args) > 0), REQUIRES(IncludesType<TIn, Ts...>::value)>
KOKKOS_INLINE_FUNCTION auto &operator()(const int b, const TIn &t, const Args... args) const {
PARTHENON_DEBUG_REQUIRE(!flat_, "Accessor cannot be used for flat packs");
const int vidx = GetLowerBound(b, t) + t.idx;
return pack_(0, b, vidx)(std::forward<Args>(args)...);
}Also ping @lroberts36
Yeah, that seems better. I've made the change with a slight modification to |
That looks reasonable, I might also add a |
lroberts36
left a comment
There was a problem hiding this comment.
Approved, but needs a changelog update
Done |
Done |
|
Should this get a quick unit test in the existing sparse pack machinery? |
PR Summary
Working with
Metadata::Nonefields in artemis that are defined as e.g.,pkg->AddField<name>(Metadata({Metadata::None, Metadata::OneCopy}, \ std::vector<int>({nx1})));To index into this in a pack, parthenon currently supports
This MR adds the ability to index as,
which is a little cleaner.
Tested in artemis. I don't think this clashes with the other available indexers (at least in artemis), but we may not cover everything.
PR Checklist