Skip to content

Commit 12c5a46

Browse files
committed
[Clang] Fix incorrect condition on ballot
Summary: Somehow these got the `!` dropped and it wasn't tested because the existing test only used the 32-bit variant.
1 parent b4ecebe commit 12c5a46

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/Headers/amdgpuintrin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ __gpu_match_any_u64(uint64_t __lane_mask, uint64_t __x) {
187187
uint64_t __match_mask = 0;
188188

189189
bool __done = 0;
190-
while (__gpu_ballot(__lane_mask, __done)) {
190+
while (__gpu_ballot(__lane_mask, !__done)) {
191191
if (!__done) {
192192
uint64_t __first = __gpu_read_first_lane_u64(__lane_mask, __x);
193193
if (__first == __x) {

clang/lib/Headers/nvptxintrin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ __gpu_match_any_u64(uint64_t __lane_mask, uint64_t __x) {
207207
uint64_t __match_mask = 0;
208208

209209
bool __done = 0;
210-
while (__gpu_ballot(__lane_mask, __done)) {
210+
while (__gpu_ballot(__lane_mask, !__done)) {
211211
if (!__done) {
212212
uint64_t __first = __gpu_read_first_lane_u64(__lane_mask, __x);
213213
if (__first == __x) {

0 commit comments

Comments
 (0)