cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Gunter
Journeyman III

fence_lds

In one of my kernels there is a whileloop with conditional exit (break_logicalz), and after this there is a fence_lds. Is this a legal placement, and does it do what it is supposed to do?  This kernel is unexpectedly performing identically with or without this instruction, and I'm trying to understand why.

thx

0 Likes
1 Reply

Breaking out of a loop only ends execution once every thread in the wavefront breaks out of the loop. So 1 thread does 1000 iterations and the rest do 1 iteration, all threads do 1000 iterations.

Fence instructions only do synchronization between wavefronts and not within wavefronts.
0 Likes