-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
MAINT,ENH: Reorganize buffered iteration setup #27883
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
8d69f05
MAINT: Refactor buffered loop to do an initial setup
seberg 7d19f2d
TST: Fixup tests to pass (for now not correct)
seberg 809cf0c
BUG: Avoid a coresize of 0
seberg 9302b30
TST: The nullpointer doesn't print uniformly accross platforms
seberg 54d967f
BUG: Add missing pointer dereference
seberg 87ad5a2
BUG: Fix coreoffset mechanism and unset buf-reuse on different (parti…
seberg 67cddf7
TST: Forgot one more nditer debug_print() fixup
seberg facd237
Apply suggestions from code review
seberg 22f335c
MAINT: Remove bufnever logic from allocate-arrays (we do it later any…
seberg ac282fc
MAINT: Rename to BUF_SINGLESTRIDE and use the new gap in the flags
seberg 6ed3b99
MAINT: Remove unnecessary fixed-stride logic
seberg 162a951
MAINT: Fill in correct buffer transferstride always
seberg 0cc37b9
MAINT: Don't use static zero (initialize by caller instead)
seberg 786e546
DOC: Improve the function documentation somewhat.
seberg d09be24
BUG: Fix typo in new assert
seberg 92ecbaf
MAINT: Reinstante the CONTIG flag (as buggy as it was)
seberg 5bad357
remove debug print (was this part of the sanitizer problem?!)
seberg 67cb5c5
TST: See if deleting a, b makes santizer tests pass
seberg 5508cc5
MAINT: Move buffersize init (new code always limits it to itersize)
seberg be6749d
DOC: Explain buffer-setup cost more (maybe should rethink it...)
seberg 426934d
DOC: Expand/change iteration explanation based on Marten's review
seberg 1836fd1
MAINT: More review comments (mostly code clarifications/simplifications)
seberg e758983
MAINT: Smaller changes based on review
seberg 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
TST: Fixup tests to pass (for now not correct)
- Loading branch information
commit 7d19f2dcbd8bb6fe51a448f2f96ba4fbfd74ad0a
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -2681,8 +2681,8 @@ def test_iter_buffering_reduction(): | |
it = np.nditer([p, None], | ||
['delay_bufalloc', 'reduce_ok', 'buffered', 'external_loop'], | ||
[['readonly'], ['readwrite', 'allocate']], | ||
op_axes=[[-1, 0], [-1, -1]], | ||
itershape=(2, 2)) | ||
op_axes=[[-1, 0], [1, 0]], | ||
itershape=(2, 2), op_dtypes=["float64", "int64"]) | ||
seberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with it: | ||
it.operands[1].fill(0) | ||
it.reset() | ||
|
@@ -3296,7 +3296,7 @@ def test_debug_print(capfd): | |
expected = """ | ||
------ BEGIN ITERATOR DUMP ------ | ||
| Iterator Address: | ||
| ItFlags: BUFFER REDUCE REUSE_REDUCE_LOOPS | ||
| ItFlags: BUFFER REDUCE | ||
| NDim: 2 | ||
| NOp: 2 | ||
| IterSize: 50 | ||
|
@@ -3321,18 +3321,19 @@ def test_debug_print(capfd): | |
| BufferData: | ||
| BufferSize: 50 | ||
| Size: 5 | ||
| BufIterEnd: 5 | ||
| BufIterEnd: 50 | ||
| REDUCE Pos: 0 | ||
| REDUCE OuterSize: 10 | ||
| REDUCE OuterDim: 1 | ||
| BUFFER CoreSize: 5 | ||
| BUFFER Reduce outersize: 10 | ||
| BUFFER OuterDim: 1 | ||
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. I suppose the reduce outersize is actually also always valid now. Which would be useful for advancing the iterator. |
||
| Strides: 8 4 | ||
| Ptrs: | ||
| REDUCE Outer Strides: 40 0 | ||
| REDUCE Outer Ptrs: | ||
| ReadTransferFn: | ||
| ReadTransferData: | ||
| ReadTransferData: 0x0 0x0 | ||
| WriteTransferFn: | ||
| WriteTransferData: | ||
| WriteTransferData: 0x0 0x0 | ||
| Buffers: | ||
| | ||
| AxisData[0]: | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.