Skip to content

MAINT: Refactor and simplify the main ufunc iterator loop code#19258

Merged
seberg merged 1 commit intonumpy:mainfrom
seberg:maint-ufunc-refactor-iterator-loop
Jun 17, 2021
Merged

MAINT: Refactor and simplify the main ufunc iterator loop code#19258
seberg merged 1 commit intonumpy:mainfrom
seberg:maint-ufunc-refactor-iterator-loop

Conversation

@seberg
Copy link
Copy Markdown
Member

@seberg seberg commented Jun 16, 2021

Simple cleanups to the main ufunc loop code in preparation of
larger ones.


Independent change, in preparation for the large NEP 43 refactor (although it makes sense on its own). Mainly to reduce the diff-size.

@seberg
Copy link
Copy Markdown
Member Author

seberg commented Jun 16, 2021

This changes the debug prints a bit, that is because it starts a merger of the "fancy" (masked) and non-fancy loops, and they differ a bit in what they print.

@seberg seberg force-pushed the maint-ufunc-refactor-iterator-loop branch from 5da9e86 to 6e144f0 Compare June 16, 2021 14:10
Copy link
Copy Markdown
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

Agreed this is better, especially not having the whole loop inside an if clause. And good to avoid a large diff for no functional change in the big PR!

Only one comment about a comment...

@seberg seberg force-pushed the maint-ufunc-refactor-iterator-loop branch 2 times, most recently from 59b7b64 to ae6b18a Compare June 16, 2021 16:25
Simple cleanups to the main ufunc loop code in preparation of
larger ones.
@seberg seberg force-pushed the maint-ufunc-refactor-iterator-loop branch from ae6b18a to 23600c6 Compare June 17, 2021 20:45
NPY_END_THREADS;
if (!needs_api) {
NPY_BEGIN_THREADS_THRESHOLDED(full_size);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wow, the original NPY_BEGIN_THREADS_NDITER is a very convoluted macro. Glad to see it gone here.

Copy link
Copy Markdown
Member

@mattip mattip left a comment

Choose a reason for hiding this comment

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

Nice cleanup. Once CI passes I think this can be merged.

@seberg
Copy link
Copy Markdown
Member Author

seberg commented Jun 17, 2021

Thanks Marten and Matti, will put it in to rebase the other one.

@seberg seberg merged commit 7d8fada into numpy:main Jun 17, 2021
@seberg seberg deleted the maint-ufunc-refactor-iterator-loop branch June 17, 2021 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants