Monday, April 29, 2013

CUDA: cudaStreamQuery(0), you son of a dirty little trick

 

If you were like me, you’d wonder how you missed this one

cudaStreamQuery(0) will force to flush the buffer on the CPU side and send work to GPU.

Therefore, in such case as when you want to fire up many kernel in sequence (e.g. don’t want to blew up the GPU memo), and then send them off (and make sure they are send off) while you can do some CPU work before you call e.g. cudaDeviceSynchronize() again, use it!

 

http://nvidia.fullviewmedia.com/gtc2013/0321-230C-S3382.html

13:55

1 comment: