cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

spectral
Adept II

Transfer between CPU & GPU... optimization ?

Hi,

I have the following code :

int updateDataSet = MustUpdateDataSet(...);

if (updateDataSet)
    kernel->setArg(i++, *dataSet);

What I would like is to avoid to send each time the 'dataset' to the GPU because it has already been sent !

So, my question is... can I do this this ? or I MUST ALWAYS set the argument ?

But if I must always use 'setArgs' ... how can I avoid to re-transfer each time the huge (a same) set of datas ?

0 Likes
4 Replies
nou
Exemplar

kernel remeber kernel arguments between invocations. so you need set args only once.

second even if you set arg you do not send that dataset to the card if they are on the card allready. buffers are sended at kernel launch.

0 Likes

Thanks,

Ok, but then... if I change the content of my buffer... how I FORCE the memory transfer ?

 

You say 'buffers are sended at kernel launch'... you mean 'at the first launch' because I call several time the same kernel.

0 Likes

if you enqueue write into buffer then it must send over buffer over PCIe. use events to get proper synchronization.

0 Likes

I don't understand 😛 sorry...

If I modify something in a char buffer

charbuffer[52] = '*';

How can I force an update ?

Thanks

0 Likes