问题
I have gone through Cuda programming guide but still not clear whether a warp will yield in favor of other ready-to-execute warp? Any explanation or pointer please? If yes, in what condition does a warp yield?
回答1:
Yes, the on-chip scheduler interleaves the execution of warps. The scheduling policy is intentionally left unspecified, because the scheduling policy may be changed. NVIDIA does not want CUDA developers to write code that relies on the current scheduling policies but fails on newer GPUs.
Generally speaking, the purpose of having multiple warps is that while one thread waits for an instruction to finish executing, another thread may be ready to execute without waiting. So it is likely that a warp will yield when a long-latency instruction such as a global load or a slow floating-point operation is executed. Some architectures, such as Fermi, execute multiple warps at the same time ( http://www.nvidia.com/content/PDF/fermi_white_papers/NVIDIA_Fermi_Compute_Architecture_Whitepaper.pdf page 10).
来源:https://stackoverflow.com/questions/5121475/does-nvidia-cuda-warp-scheduler-yield