-
Notifications
You must be signed in to change notification settings - Fork 197
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
[FEA] Helpers for identifying contiguous layouts. #1861
Merged
rapids-bot
merged 10 commits into
rapidsai:branch-23.12
from
trivialfis:mdspan-is-contiguous
Oct 12, 2023
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b315dad
Helpers for identifying contiguous layouts.
trivialfis 452cb34
Merge branch 'branch-23.10' into mdspan-is-contiguous
trivialfis 119ccc1
Merge branch 'branch-23.10' into mdspan-is-contiguous
cjnolet 2fa33a9
Merge branch 'branch-23.12' into mdspan-is-contiguous
cjnolet bfd89b6
Merge branch 'branch-23.12' into mdspan-is-contiguous
trivialfis 4f3001b
correct types and remove np bytes stride.
trivialfis dceed21
ensure the unit.
trivialfis 3e2a4d8
Merge branch 'branch-23.12' into mdspan-is-contiguous
trivialfis 36dbeca
Merge remote-tracking branch 'jiamingy/mdspan-is-contiguous' into mds…
trivialfis a3ce1b5
auto header.
trivialfis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,4 +247,20 @@ void test_const_mdspan() | |
|
||
TEST(MDSpan, ConstMDSpan) { test_const_mdspan(); } | ||
|
||
void test_contiguous_predicates() | ||
{ | ||
extents<std::int64_t, dynamic_extent, dynamic_extent, dynamic_extent> exts{10, 10, 10}; | ||
{ | ||
std::array<std::size_t, 3> strides{128, 32, 8}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be |
||
ASSERT_TRUE(is_c_contiguous(exts, strides)); | ||
ASSERT_FALSE(is_f_contiguous(exts, strides)); | ||
} | ||
{ | ||
std::array<std::size_t, 3> strides{8, 32, 128}; | ||
ASSERT_FALSE(is_c_contiguous(exts, strides)); | ||
ASSERT_TRUE(is_f_contiguous(exts, strides)); | ||
} | ||
} | ||
|
||
TEST(MDArray, Contiguous) { test_contiguous_predicates(); } | ||
} // namespace raft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your test case, in the first iteration isn't
stride = 1
andstrides[r - 1] = 8
wherer = 3
? I don't understand how this doesn't exit in the first iteration itself