cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

spectral
Adept II

Refresh buffer content : performance ?

Hi,

Imagine that I use the same buffer each time I call a kernel. Its size does not change, just its content.

To refresh the content should I delete and recreate a new buffer or there is a faster way to "refresh" the content of a buffer ?

I can also use "enqueueWriteBuffer", but is there a better way ?

Thx

0 Likes
3 Replies
himanshu_gautam
Grandmaster

Global memory is persistent between kernel calles. The modified data will be directly available to the second kernel. You can see this happening in LUDecomposition sample.

0 Likes

Thanks,

I know this 🙂

But it is just that I execute the same kernel several times, each time I have to update my buffer.

So, by example, does the "map" buffer methods are faster/better than the "enqueue" methods ?

Thanks Himanshu

0 Likes

Yes, In general map/unmap path would give better performance than clEnqueueWriteBuffer method.

0 Likes