8000 ENH: allocate working buffers outside ufunc's inner loop · Issue #11510 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: allocate working buffers outside ufunc's inner loop #11510

@mattip

Description

@mattip

Working on matmul in #11133, and comparing to the linalg inner loops, I ran into a need for a working buffer much like linalg. In umath_linalg.c.src each iteration of the inner loop mallocs/frees the working memory. There seems to be no generic support for passing in a working buffer allocated once for the ufunc call.

The PyUFuncGenericFunction signature has a innerloopdata argument, but I could find no examples of its use in linalg. In the actual inner loops in umath_linalg.c.src and elsewhere it is marked as NPY_UNUSED(func)

The only place I could find a use for this argument is in unmasked_ufunc_loop_as_masked where it is used to hold a structure, not a function.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0