def use_independent_scheduling(arr): i = cuda.threadIdx.x if i % 4 == 0: ballot = cuda.ballot_sync(0x11111111, True) elif i % 4 == 1: ballot = cuda.ballot_sync(0x22222222, True) elif i % 4 == 2: ballot = cuda.ballot_sync(0x44444444, True) elif i % 4 == 3: ballot = cuda.ballot_sync(0x88888888, True) arr[i] = ballot
def use_vote_sync_ballot(ary): i = cuda.threadIdx.x ballot = cuda.ballot_sync(0xffffffff, True) ary[i] = ballot