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

MAINT: combine string ufuncs by passing on auxilliary data #25796

Merged
merged 7 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions numpy/_core/include/numpy/dtype_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ typedef struct {
#define NPY_METH_unaligned_strided_loop 7
#define NPY_METH_unaligned_contiguous_loop 8
#define NPY_METH_contiguous_indexed_loop 9
#define _NPY_METH_static_data 10


/*
Expand Down
3 changes: 3 additions & 0 deletions numpy/_core/src/multiarray/array_method.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ fill_arraymethod_from_slots(
case NPY_METH_contiguous_indexed_loop:
meth->contiguous_indexed_loop = slot->pfunc;
continue;
case _NPY_METH_static_data:
meth->static_data = slot->pfunc;
continue;
default:
break;
}
Expand Down
3 changes: 3 additions & 0 deletions numpy/_core/src/multiarray/array_method.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ typedef struct PyArrayMethodObject_tag {
NPY_CASTING casting;
/* default flags. The get_strided_loop function can override these */
NPY_ARRAYMETHOD_FLAGS flags;
/* pointer to possible data needed inside the loop (e.g., a function pointer) */
void *static_data;
/* functions to help decide which loop to call and how to prepare for it */
PyArrayMethod_ResolveDescriptorsWithScalar *resolve_descriptors_with_scalars;
PyArrayMethod_ResolveDescriptors *resolve_descriptors;
PyArrayMethod_GetLoop *get_strided_loop;
Expand Down
Loading
Loading