cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

yurtesen
Miniboss

Single context multi-device memory objects question

I wrote a program which uses single context and multiple queues/devices (a queue per device). I am using OpenMP to create threads per queue.

I have several read_only memory objects and I have read_write objects per queue.

I realized that the kernels(same kernel on multiple devices) seem to run sequentially even when they are queued in parallel by threads, this happens if the read_only objects are shared between devices. Is this correct behaviour? I thought this would make sense for read/write objects since both kernels shouldnt update them at the same time. But shouldnt OpenCL be able to tell that this is not a problem for read_only objects?

I have changed the program to have read_only objects per queue also. Now kernels appear to run concurrently. However a side effect seems to be that the all read-only objects are copied into both devices even when they wont be used on that card.

Thanks,

Evren

0 Likes
2 Replies
Wenju
Elite

Hi, Evren

     I think the behaviour is correct.But I need know that how do you know  the all read-only objects are copied into both devices?

Thanks

0 Likes

In my case I used CL_MEM_COPY_HOST_PTR at first and that causes everything to be copied to all the devices.(which is normal) This was because I thought I can have one read-only memory object copied to both cards and wont interfere with running of kernels. But then I had to make separate objects but I forgot to change the type. I cant tell what AMD SDK does, but on Nvidia cards, I am able to use nvidia-smi to see the memory usage so thats how I realized the stuff was being copied all around

0 Likes