[Numpy-discussion] Starting to work on runtime plugin system for plugin (automatic sse optimization, etc...)

Stéfan van der Walt stefan@sun.ac...
Mon Apr 28 11:00:16 CDT 2008


2008/4/28 David Cournapeau <david@ar.media.kyoto-u.ac.jp>:
>     - this could also be used for core numpy, for example ufuncs: if we
>  want to start implementing some tight loop with aggressively optimized
>  code (SSE, etc...), we could again ship with a default pure C
>  implementation, and choose the best one at runtime.

This would be a *fantastic* addition, especially if a user can add his
own ufuncs written in, say Cython.

>  Right now, the prototype does not do much, and only works for linux; I
>  mainly focused on automatic generation of the plugin from a list of
>  functions, and transparent use from numpy point of view. It provides the
>  plugin api through pure function pointers, without the need for the user
>  to be aware of it. For example, if you have an api with the following
>  functions:
>
>  void    foo1();
>  int     foo2();
>  int     foo3(int);
>  int     foo4(double* , double*);
>  int     foo5(double* , double*, int);
>
>  The current implementation would build the boilerplate to load those
>  functions, etc... and you would just use those functions in numpy like
>  the following:

I assume that, since you call it a plugin system, it can be done at
runtime a-la ctypes?

Cheers
Stéfan


More information about the Numpy-discussion mailing list