[Gpundarray] as_{contiguous,fortran}array and opencl
Frédéric Bastien
nouiz at nouiz.org
Wed Nov 16 11:57:56 PST 2011
2011/11/16 Andreas Kloeckner <lists at informa.tiker.net>:
> On Wed, 16 Nov 2011 14:00:56 -0500, Frédéric Bastien <nouiz at nouiz.org> wrote:
>> 2011/11/16 Andreas Kloeckner <lists at informa.tiker.net>:
>> > You can't--that's why (CUDA pointer)=(CL mem
>> > object+offset). (Technically, there are sub-buffers, but those are CL
>> > 1.1-only, and I'm not sure if they have performance implications.
>>
>> I know that we need to keep and use the original pointer that the
>> opencl driver created. My question is how a such pointer created by
>> compyte can be passed to a gpu function created by pyopencl?
>
> Compyte isn't allowed to create pointers. It has to modify the offset,
> and the 'pointer' must be passed as mem object+offset to the device.
>
> Unless I'm misunderstanding your question somehow, that's what it is.
I agree whit what you tell, but that is not the question I have.
Currently, compyte call this to create a memory region:
clCreateBuffer(ctx, CL_MEM_READ_WRITE, size, NULL, &err);
I have access to the result of that call in python by calling
MyGpuNdArray.bytes. How can I pass that to a gpu function compiled
with pyopencl? We never change the output of clCreateBuffer.
Fred
More information about the Gpundarray
mailing list