Can division operations create a warp divergence? Well, I realize that different execution paths within a warp can create a warp divergence. But what about division? I mean, divisions, depending on the number, may require a different number of steps to complete. For example, if 2 different threads within a warp execute a 2/2 and 10248/2 respectively, the second thread would have to execute more steps until the end of the division. That’s why, I, again, ask, can divisions cause warp divergence? If the answer is yes, are multiplications susceptible to causing warp divergence as well? I mean, I know it may sound a weird question, it is just, I’m a beginner in CUDA, and I’m really trying to understand how it works.
Sure, division on a GPU is implemented in a code sequence. If that code sequence has any data dependent conditional activity (such as following a slow path or fast path) then there could be warp divergence.
Most typical multiplications on a GPU that I am aware of are implemented with a single machine code instruction. There is no code sequence involved, and therefore no possibility to introduce conditional behavior, and therefore no divergence.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.