Skip to content

Move some gufunc-specific code from ufunc.c template to GUFunc class#285

Merged
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:only-free_b-in-gufunc
Jul 3, 2026
Merged

Move some gufunc-specific code from ufunc.c template to GUFunc class#285
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:only-free_b-in-gufunc

Conversation

@eerovaher

Copy link
Copy Markdown
Contributor

When I implemented the GUFunc class in 489b9a8 I made a simplifying assumption that code which is specific to gufuncs could be found by grepping for func.signature in the ufunc.c template, but now I've found some gufunc code that did not mention func.signature at all. Such code should be implemented in the GUFunc class, not in any template.

Comment thread erfa/ufunc.c.templ
i_o++, {{ func.increment_arg_pointers }}) {
{{ func.ufunc_loop_inner_loop_body | indent(8) }}
}
{%- if func.user_dtype == 'dt_eraLDBODY' %}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If func.user_dtype == 'dt_eraLDBODY' then that means there must be an Argument with ctype value eraLDBODY, but that in turn means the signature_shape of that Argument is "(n)", not "()", so Function.from_c_code() indeed decides to create a GUFunc, not a UFunc.

@avalentino avalentino merged commit 2f3239f into liberfa:main Jul 3, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants