Passing user data to SciPy LowLevelCallables

0 views
Skip to first unread message

Juan Nunez-Iglesias

unread,
May 16, 2018, 5:57:20 AM5/16/18
to Numba Public Discussion - Public
Hi all,

I’ve recently been revisiting my old blog posts [0, 1]_ on writing LowLevelCallables using Numba. In order to be truly useful as generic_filters, these must be able to take one or more extra_args and extra_kwargs. (See for example the comments on my post [2]_.) Of course these are of indefinite type, since one can imagine filters using all sorts of tricks, so using them would involve casting a voidptr to its true type. This StackOverflow answer [3]_, which links to the original cfunc NBEP [4]_, suggest that it’s not possible to do this.

Questions:

1 - Is it really actually impossible currently to receive extra data in the filter function (or other LowLevelCallable)?
2 - If so, is there anything to be done about it internally with Numba, and would this task be accessible to someone with no experience writing compilers such as yours truly? ;)
3 - Either way, would something like making a closure out of the filter function work? ie creating a specialised filter function for each combination of external arguments that one wants?

Thanks,

Juan.


Reply all
Reply to author
Forward
0 new messages