Thanks Andreas. Yes, I agree it is more of a numpy question since I need to
control allocation of numpy array. But I really need for the host pointer
in opencl to be aligned to a particular boundary. I will check out the
link, hopefully it will get me an 'aligned_malloc' kind of functionality...
dont mind throwing in few extra bytes either.

On Thu, Dec 20, 2012 at 2:00 PM, Andreas Kloeckner
<[email protected]>wrote:

> Dear Sushma,
>
> sushma r <[email protected]> writes:
> > I would like to ensure that host memory pointers are aligned on a
> > particular boundary to ensure good cache use (say by using the device
> query
> > MEM_BASE_ADDR_ALIGN to get best alignment for a device)
> > Is there a way to specify that? Since numpy is used to define the array,
> > for e.g. a = numpy.random.rand(50000).astype(numpy.float32) I don't
> really
> > have control over how the allocation is done. Is there pre-set alignment?
> > If yes, what is it?
>
> This seems more like a numpy issue than a (Py)OpenCL issue. Here's a
> message from the numpy list that discusses this:
>
> http://mail.scipy.org/pipermail/scipy-user/2009-March/020283.html
>
> As far as OpenCL is concerned, CL buffers are always aligned to the
> largest granularity that the hardware cares about.
>
> Andreas
>
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to