public static void AllAnyBallotTests(GThread thread, float[] data) { thread.SyncThreadsCount(true); thread.All(true); thread.Any(true); thread.Ballot(true); }
public static void BallotKernel(GThread thread, int[] input, int[] output) { var tid = thread.threadIdx.x; var wid = thread.threadIdx.x / 32; var twid = thread.threadIdx.x % 32; int value = input[tid]; bool predicate = value == 1; var ballot = thread.Ballot(predicate); if (twid == 0) output[wid] = ballot; }
public static void BallotKernel(GThread thread, int[] input, int[] output) { var tid = thread.threadIdx.x; var wid = thread.threadIdx.x / 32; var twid = thread.threadIdx.x % 32; int value = input[tid]; bool predicate = value == 1; var ballot = thread.Ballot(predicate); if (twid == 0) { output[wid] = ballot; } }