cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ThomasUCF
Journeyman III

different GPU share same buffer problem

 Hi all:

     If different GPUs share the same buffer, like the code below in "simpleMultiDevice":

     for(int i = 0; i < numGPUDevices; i++)
    {
        gpu.inputBuffer = inputBuffer;
        gpu
.outputBuffer = outputBuffer;
    }

In which GPU exactly is the buffer physically located?

If I change the value of the buffer, say gpu[0].inputBuffer , does it mean the values are changed in each GPU buffer,say gpu[1].inputBuffer or gpu[2].inputBuffer or gpu[3].inputBuffer since they share the same inputBuffer?

  Thanks a lot.

 

  ThomasUCF

 

0 Likes
4 Replies
ThomasUCF
Journeyman III

 Let me correct myself, the code is:

  for(int i = 0; i < numGPUDevices; i++)
    {
        gpu.inputBuffer = inputBuffer;
        gpu.outputBuffer = outputBuffer;
    }

0 Likes

 why this page can not show square bracket in my code? there shoud be left square bracket i right square bracket in my code.

0 Likes

because square bracket are used as formating mark to create like HTML tag.

and that i in [] create Italic text.

buffers re created on all devices. if you change input buffer it will change on all devices. you must only ensure proper synchronization across diferent command queues.

as you enqueue action which change buffer on queue1 then you must ensure that any action which is depend on this buffer do not start before end that action on queue1.

0 Likes

It is advised to write code snippets by using the attach code option.

0 Likes