Created by: cjld
The previous pr #15296 has race condition bug, fix it by cudaStreamWaitEvent
cudaStreamWaitEvent