8000 ENH: create and use indexed inner loops by mattip · Pull Request #23136 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: create and use indexed inner loops #23136

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 20 commits into from
Feb 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BUG: improve check for 1d operands (from review)
  • Loading branch information
mattip committed Feb 7, 2023
commit 163d3c533d37fa76727ecdee429446ad41aac7f2
5 changes: 4 additions & 1 deletion numpy/core/src/umath/ufunc_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -6436,12 +6436,15 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args)
/*
* Try to use trivial loop (1d, no casting, aligned) if
* - the matching info has a indexed loop
* - idx must be exactly one integer index array
* - all operands are 1d
* A future enhancement could loosen the restriction on 1d operands
* by adding an iteration loop inside trivial_at_loop
*/
if ((ufuncimpl->contiguous_indexed_loop != NULL) &&
(PyArray_NDIM(op1_array) == 1) &&
(op2_array != NULL && PyArray_NDIM(op2_array) == 1) &&
(iter->nd == 1)) {
(iter->subspace_iter == NULL) && (iter->numiter == 1)) {
res = trivial_at_loop(ufuncimpl, flags, iter, op1_array,
op2_array, &context);

Expand Down
0