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

Provide pushforward methods for Kokkos::View indexing #1061

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

gojakuch
Copy link
Collaborator

Previously, we relied on automatically generated pushforwards for these operator calls, but this solution is way safer and should work for more machines and Kokkos versions.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.34%. Comparing base (6f4b081) to head (29127cd).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1061   +/-   ##
=======================================
  Coverage   94.34%   94.34%           
=======================================
  Files          55       55           
  Lines        8311     8311           
=======================================
  Hits         7841     7841           
  Misses        470      470           

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@kliegeois
Copy link

This looks great but I would add a last version with 8 arguments as views can have up to 8 dimensions. Thanks!

Previously, we relied on automatically generated pushforwards
for these operator calls, but this solution is way safer and
should work for more machines and Kokkos versions.
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@vgvassilev vgvassilev merged commit c3b76c0 into vgvassilev:master Aug 26, 2024
89 checks passed
@kliegeois
Copy link

@gojakuch now that I am thinking about it, the code of the PR needs to be changed.

In Kokkos, the index type is templated with a different template for each indices. Example:

  // rank 4
  template <typename I0, typename I1, typename I2, typename I3>
  KOKKOS_INLINE_FUNCTION constexpr size_type operator()(I0 const& i0,
                                                        I1 const& i1,
                                                        I2 const& i2,
                                                        I3 const& i3) const {
    return i0 + m_dim.N0 * (i1 + m_dim.N1 * (i2 + m_dim.N2 * i3));
  }

The merged code works only if I0, ... I3 are the same.
Could you fix that and add a test that uses a view indexing of at least 2 dimensions where one is a int and one is a size_t index? Thanks!

@gojakuch
Copy link
Collaborator Author

@kliegeois I see. I'll open a PR today then

@kliegeois
Copy link

Thanks a lot @gojakuch !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants