[Numpy-discussion] Vectorized ufuncs with OS X frameworks

Francesc Altet faltet@carabos....
Wed Mar 14 07:47:36 CDT 2007

Hi Eric,

A Divendres 09 Març 2007 15:32, Eric Brown escrigué:
> Hi All,
> 	I have a set of large arrays to which I have to do exp functions
> over and over again. I am wondering if there is any benefit to
> teaching numpy how to use the vForce frameworks to do this function.
> 	Does anyone have experience hacking the source to get numpy to use
> system libraries to do vectorized versions of sqrt, exp, log,
> addition, etc.?  I am also interested in doing this for other
> operating systems.

Maybe it is not what you want, but perhaps it is worth for you to have a look 
at numexpr [1] which has a kernel for vectorizing the sort of computations 
you are interested in (sqrt, exp, log, pow, trigonometric, addition...). It 
does the vectorization by extracting blocks of the numpy arrays and passing 
them to the computing kernel (which are macros in C for achieving maximum 

Also, it should be possible to adapt the kernel of numexpr for VForce, 
although I'm not sure about how vForce is going to achieve more efficiency 
than numexpr, as IMO the cost for these kind of computations is mostly 
dominated by fetch/store memory cells rather than doing actual computations 
(although I might be wrong).

[1] http://projects.scipy.org/scipy/scipy/browser/trunk/Lib/sandbox/numexpr/


>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data

More information about the Numpy-discussion mailing list