A CPU thread doesn’t “know” when a kernel is finished. It can effectively ask the CUDA runtime if the GPU is finished by using a runtime API function such as cudaDeviceSynchronize, cudaStreamSynchronize, cudaMemcpy, cudaEventSynchronize, etc. Any of these calls may force the CPU thread to wait at the call until the GPU is finished/idle.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| How does the CPU know when a GPU kernel finishes? | 4 | 2422 | September 25, 2014 | |
| GPU communication with the CPU | 3 | 3617 | March 9, 2009 | |
| Device Handling | 4 | 920 | June 10, 2011 | |
| How does CPU know that GPU kernel is finished? | 1 | 716 | January 17, 2019 | |
| Kernel Runtime | 9 | 5789 | July 9, 2008 | |
| cudaDeviceSynchronize() doesn't wait for kernels launched by other CPU threads, why? | 7 | 2422 | October 12, 2021 | |
| Using GPU and CPU at the same time | 5 | 7033 | March 4, 2009 | |
| cuda host device Question | 3 | 6448 | December 1, 2010 | |
| Thread destiny where do they go? | 1 | 1176 | September 7, 2008 | |
| STATUS OF CALL Status of kernel Execution | 2 | 6974 | December 17, 2007 |