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 padded layout annotations and add tagged raw array constructor to layout_stride #327

Merged
merged 4 commits into from
May 31, 2024

Conversation

nmm0
Copy link
Contributor

@nmm0 nmm0 commented Apr 24, 2024

Fixes #326

Additionally, some device code cannot use std::array so this adds a "non-standard" constructor to layout_stride that accepts a raw array to support this use case

@nmm0 nmm0 requested a review from crtrott April 24, 2024 21:45
Comment on lines +346 to +357
/*
* TODO: check preconditions
* - s[i] > 0 is true for all i in the range [0, rank_ ).
* - REQUIRED-SPAN-SIZE(e, s) is a representable value of type index_type ([basic.fundamental]).
* - If rank_ is greater than 0, then there exists a permutation P of the integers in the
* range [0, rank_), such that s[ pi ] >= s[ pi − 1 ] * e.extent( pi − 1 ) is true for
* all i in the range [1, rank_ ), where pi is the ith element of P.
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO is just a copy and paste from the std::array constructor

nmm0 added a commit to nmm0/kokkos that referenced this pull request Apr 24, 2024
Copy link
Contributor

@mhoemmen mhoemmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix!

nmm0 added a commit to nmm0/kokkos that referenced this pull request May 1, 2024
@crtrott crtrott force-pushed the 326-fix-padded-layout-annotations branch from 0940586 to 0ad1b26 Compare May 3, 2024 17:19
Copy link
Member

@crtrott crtrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you ran clang-format over this thing?

namespace MDSPAN_IMPL_STANDARD_NAMESPACE {
constexpr struct mdspan_non_standard_tag {
} mdspan_non_standard;
} // namespace MDSPAN_IMPL_STANDARD_NAMESPACE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go into the utility header introduced by the cpp14 support PR

nmm0 added a commit to nmm0/kokkos that referenced this pull request May 13, 2024
nmm0 added a commit to nmm0/kokkos that referenced this pull request May 15, 2024
@nmm0 nmm0 force-pushed the 326-fix-padded-layout-annotations branch from 0ad1b26 to f08661a Compare May 29, 2024 22:36
@crtrott crtrott merged commit 59a70bb into kokkos:stable May 31, 2024
14 checks passed
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.

missing __host__ __device__ in padded layouts
3 participants