putMapBuffer on CPU-based OpenCL devices

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

putMapBuffer on CPU-based OpenCL devices

suleman
Hi,

I have two questions.
(1) Is putMapBuffer (CLCommandQueue class) used on CPU based OpenCL devices results in no-copy on CPU devices?
(2) "putMapBuffer"  method always returns a ByteBuffer?  am i required to cast this bytebuffer to other types or not? Any example will be great. e.g. i have a flot buffer and i want to map this instead of using putReadBuffer and putWriteBuffer buffers on CPUs

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: putMapBuffer on CPU-based OpenCL devices

Michael Bien

On 06/27/2011 06:04 PM, suleman [via jogamp] wrote:

> Hi,
>
> I have two questions.
> (1) Is putMapBuffer (CLCommandQueue class) used on CPU based OpenCL devices
> results in no-copy on CPU devices?
> (2) "putMapBuffer"  method always returns a ByteBuffer?  am i required to
> cast this bytebuffer to other types or not? Any example will be great. e.g.
> i have a flot buffer and i want to map this instead of using putReadBuffer
> and putWriteBuffer buffers on CPUs
>
> Thanks
>
1) yes probably. Same as putRead/WriteBuffer - but thats implementation
dependent
2.) bytebuffer.asFooBuffer(). You are not required to change the view of
the buffer, you can just use the ByteBuffer view, it exposes the
functionality of all specific buffers.
http://download.oracle.com/javase/6/docs/api/java/nio/ByteBuffer.html

regards,
michael

--
http://michael-bien.com/