How to time CUDA Event


In CUDA C, you can time how long GPU ran by using event, this will record the time for just GPU running time, which does not include data transfer. Is there a similar functionality in CuArray or other GPU packages?

CUDAdrv wraps the event API. You can use CUDAdrv.@elapsed to automatically enqueue events before and after code and return the elapsed time between both. Or manually construct CuEvents and call record/synchronize/elapsed on them.

Thank you! Is there any difference in reporting between the two methods?

No, one is built on top of the other: