[Numpy-discussion] GPU Numpy

Romain Brette romain.brette@ens...
Wed Aug 5 05:45:42 CDT 2009

Hi everyone,

I was wondering if you had any plan to incorporate some GPU support to numpy, or
perhaps as a separate module. What I have in mind is something that would mimick
the syntax of numpy arrays, with a new dtype (gpufloat), like this:

from gpunumpy import *
x=zeros(100,dtype='gpufloat') # Creates an array of 100 elements on the GPU
z=exp(2*x+y) # z in on the GPU, all operations on GPU with no transfer
z_cpu=array(z,dtype='float') # z is copied to the CPU
i=(z>2.3).nonzero()[0] # operation on GPU, returns a CPU integer array

I came across a paper about something like that but couldn't find any public

There is a library named GPULib (http://www.txcorp.com/products/GPULib/) that
does similar things, but unfortunately they don't support Python (I think their
main Python developer left).
I think this would be very useful for many people. For our project (a neural
network simulator, http://www.briansimulator.org) we use PyCuda
(http://mathema.tician.de/software/pycuda), which is great, but it is mainly for
low-level GPU programming.


More information about the NumPy-Discussion mailing list