[Numpy-discussion] NumPy to CPU+GPU compiler, looking for tests

Frédéric Bastien nouiz at nouiz.org
Mon Oct 29 11:11:43 EDT 2012


On Tue, Oct 23, 2012 at 11:48 AM, Henry Gomersall <heng at cantab.net> wrote:
> On Tue, 2012-10-23 at 11:41 -0400, Frédéric Bastien wrote:
>> Did you saw the gpu nd array project? We try to do something similar
>> but only for the GPU.
>>
> Out of interest, is there a reason why the backend for Numpy could not
> be written entirely in OpenCL?
>
> Assuming of course all the relevant backends are up to scratch.
>
> Is there a fundamental reason why targetting a CPU through OpenCL is
> worse than doing it exclusively through C or C++?

First, opencl do not allow us to do pointor arythmetique. So when
taking a slice of an ndarray, we can't just more the pointor. So we
need to change the object structure.

I didn't do any speed anylysis of this, but I think that by using
OpenCL, it would have a bigger overhead. So it is only useful for
"big" ndarray. I don't have any size in mind too. I don't know, but if
we could access the opencl data directly from C/C++, we could bypass
this for small array if we want. But maybe this is not possible!

Fred



More information about the NumPy-Discussion mailing list