Brilliant! Thanks Lev!
________________________________ From: Lev Givon <[email protected]> To: Mike Tischler <[email protected]> Cc: [email protected] 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 >indexing > > > 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. L.G.
_______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
