You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to better support both #349 and PDL libraries that want to pass callbacks (PDL::LinearAlgebra, PDL::GSL::MROOT, among others), it would be good to make transformations' vtables more of a first-class entity. Things I can think of needed:
have a package array variable listing all the xforms
have a Perl class method that can instantiate a vtable
store the various types of Code in the vtable
make those available as Perl methods, maybe including an as_hashref method
break out the per-gentype code snippets into separate kernel functions, put them in a vtable array entry
allow a vtable object to be passed as a callback for e.g. PDL::GSL::MROOT - this would mean not needing to enter Perl space for each callback-call
As noted on https://sourceforge.net/p/pdl/mailman/message/59118263/ - this would help with both loop fusion (if a single-step version of readdata/writebackdata is also generated), and implementing "einops". Both the latter would be "meta-functions".
To bring over the thought from #505 to enable closing that:
Another thing that would help generally (including for callbacks) is being able to stack-allocate a struct pdl and then call an inline function (which would live in pdl.h) to initialise it; this could then also be used in pdl_pdlnew itself, so there'd be only one "source of truth" for initialisation. There should also be a slightly more powerful version that also initialises dims and datatype, and a further one that also initialises with data (usable by this).
In order to better support both #349 and PDL libraries that want to pass callbacks (PDL::LinearAlgebra, PDL::GSL::MROOT, among others), it would be good to make transformations' vtables more of a first-class entity. Things I can think of needed:
Code
in the vtableas_hashref
methodThis also links to #505.
The text was updated successfully, but these errors were encountered: