Can the srcLane in __shfl_sync() function be relative?

For example, can srcLane be Lane_Id %4?
I obtained the correct result in test, but it seems that the programming guide does not explicitly state it

Yes, its acceptable. This is a variable parameter to the function call. You can populate that variable however you wish.

1 Like

To be more specific: Each thread can independently calculate a number (in the correct range) by any means and can then use it as srcLane for a __shfl_sync() call. Although the __shfl_sync() is an instruction executed by multiple threads, the srcLane is an independent parameter like any data.

1 Like

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