synchronization between the host and the stream

Hello everyone,

Does cudaStreamSynchronize() only synchronize the host with the specified stream when all operations in that stream have been completed? Or it can synchronize the host with the stream at a certain point during the execution of the stream. If no, is there anyway to synchronize the host and the stream when the stream is running? Thanks a lot.

You want cudaEventSynchronize with a cudaEvent at a particular point in a stream, not cudaStreamSynchronize.

You can synchronize using cudaEvent if that helps.

N.

Damn, that’s so obvious.

Thanks a lot, Tim and Nico.