[PyCUDA] index multiple blocks and grids
mikethesoilsguy at yahoo.com
Fri Mar 25 06:35:21 PDT 2011
Brilliant! Thanks Lev!
From: Lev Givon <lev at columbia.edu>
To: Mike Tischler <mikethesoilsguy at yahoo.com>
Cc: pycuda at tiker.net
Sent: Fri, March 25, 2011 9:33:30 AM
Subject: Re: [PyCUDA] index multiple blocks and grids
Received from Lev Givon on Thu, Mar 24, 2011 at 07:19:49PM EDT:
> Received from Mike Tischler on Thu, Mar 24, 2011 at 06:30:20PM EDT:
> > Lev,
> > Thanks for the explanation...that definitely helps. But how does the
> > work for a 2d case?
> > z1 = numpy.zeros((1024)).astype(numpy.float32)
> > kernel1(drv.Out(z1),block=(16,16,1),grid=(2,2))
> > int idx=??
> > int idy =??
> > Thanks!
> > Mike
> There are a variety of ways. I have attached an example that accesses
> a 2D array as a 1D array.
Sorry - I accidentally transposed the grid dimensions. Change
grid=(4,1) to grid=(1,4) and it should work.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyCUDA