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

Padded layout #237

Merged
merged 68 commits into from
Oct 20, 2023
Merged

Padded layout #237

merged 68 commits into from
Oct 20, 2023

Conversation

nmm0
Copy link
Contributor

@nmm0 nmm0 commented Feb 2, 2023

This has all of p2642 except 4.3 4.4 submdspan.* which I'm adding in another PR

@nmm0 nmm0 requested review from crtrott and mhoemmen February 2, 2023 03:03
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved

template <typename _T>
static constexpr auto
__construct_with_type(const _Extents &__extents, const extents<typename _Extents::index_type, _NewExtent> &__new_extents)
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a neat way to do it! I hadn't thought about how to make the left and right versions share implementation details.

include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
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.

Looks pretty good. There are a few renames which I think would improve clarity.

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 so much for taking care of this!

include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
static constexpr rank_type __extent_to_pad_rank = 0;

static_assert((padding_stride != 0)
|| (extents_type::static_extent(__extent_to_pad_rank) == 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you consider reformatting so that the || goes at the end of the line? The spacing here looks a bit odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I personally prefer the operator at the beginning of the line for readability; however you're right that the spacing is weird. I retabbed it so that the || is aligned with the opening parenthesis

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.

I think the condition on the layout_left/right constructors are wrong?

include/experimental/__p0009_bits/layout_left.hpp Outdated Show resolved Hide resolved
include/experimental/__p0009_bits/layout_right.hpp Outdated Show resolved Hide resolved
Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

only scratched the surface

include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
tests/test_layout_padded_left.cpp Outdated Show resolved Hide resolved
tests/test_layout_padded_left.cpp Outdated Show resolved Hide resolved
@nmm0 nmm0 marked this pull request as ready for review March 14, 2023 21:36
@nmm0 nmm0 changed the title WIP: Padded layout Padded layout Mar 14, 2023
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.

Lots of great tests -- great work!!!

include/experimental/__p0009_bits/layout_left.hpp Outdated Show resolved Hide resolved
include/experimental/__p0009_bits/layout_left.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
mhoemmen pushed a commit to mhoemmen/mdspan that referenced this pull request Jul 26, 2023
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.

Bunch of comments

include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
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.

First partial pass

include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded_fwd.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
include/experimental/__p2642_bits/layout_padded.hpp Outdated Show resolved Hide resolved
nmm0 and others added 27 commits October 20, 2023 10:01
@crtrott crtrott merged commit ed5f6f6 into kokkos:stable Oct 20, 2023
4 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.

5 participants