cl_mem and devices inside a context...

I have a basic doubt about cl_mem thing…

Say, I have a context made out of 2 CUDA GPUs. Now I create a cl_mem structure on top of it…

Later, I issue a clEnqueueRead… request to read that buffer…

Now, how much of that buffer comes from device 0 and how much comes from device 1?

viewtopic.php?f=28&t=1927

pmdinu, Thanks for your reply.

I still have some questions…

Now, I understand that cl_mem buffer is associated with both devices…in the context. Fine.

So, when I spawn a kernel, and if the kernel that runs on both the devices update this buffer – what happens??

WIll it not result in confusion?

Glad if some1 could help me out here. Thanks!

Hi Sarnath,
clEnqueueRead has a one to one mapping with a device trough the clQueue object.

pmdinu

pmdinu,

You opened my eyes… I did not realize that command queue is device specific… Hmm…

Interesting… So, it is logically like dividing a buffer across multiple devices…

Okay, Thanks for the info!!!

That REALLY helped!

Best Regards,
Sarnath