Should I call cudaDeviceSynchronize between successive npp/cufft/cublas calls in default stream?

thanks , I got different answers on web and get confused.

more context might be needed. In the general case I would say no, there is no particular reason to call a synchronizing function in-between work issued into the default stream. The default stream has device-side synchronizing semantics for such work (actually, any given stream has such semantics, considering only the work issued into that stream).

There might be other factors to consider, however. For example, if you are using managed memory, “directly accessible” from both host and device code, then to ensure correctness of results after any async work issued to the device (e.g. when subsequently looking at results from host code), then a synchronization may be necessary.

1 Like

very clear answer,thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.