Warp Vote Functions

Hi, I’m curious what the correct semantics of this piece of code is: Assume it’s being run over 64 threads. I’m also interested in what happens when the predicate gets more complicated.

void __kernel__ func(int *global_memory) {

	if (threadIdx.x % 2 == 0)

		return;

	

	global_memory[threadIdx.x] = __all(true);

}

From the PTX 1.4 manual:

The key point is that the vote is across all threads in the warp that are active. I believe that in your example, global_memory[1], global_memory[3], etc, should be true. global_memory[0], global_memory[2], etc should be uninitialized.