Skip to content

Commit 41aefdb

Browse files
AustinSchuhtstellar
authored andcommitted
cuda clang: Fix argument order for __reduce_max_sync (llvm#132881)
Fixes: llvm#131415 --------- Signed-off-by: Austin Schuh <[email protected]> (cherry picked from commit 2d1517d)
1 parent 19c2e1c commit 41aefdb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

clang/lib/Headers/__clang_cuda_intrinsics.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -515,32 +515,32 @@ __device__ inline cuuint32_t __nvvm_get_smem_pointer(void *__ptr) {
515515
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 800
516516
__device__ inline unsigned __reduce_add_sync(unsigned __mask,
517517
unsigned __value) {
518-
return __nvvm_redux_sync_add(__mask, __value);
518+
return __nvvm_redux_sync_add(__value, __mask);
519519
}
520520
__device__ inline unsigned __reduce_min_sync(unsigned __mask,
521521
unsigned __value) {
522-
return __nvvm_redux_sync_umin(__mask, __value);
522+
return __nvvm_redux_sync_umin(__value, __mask);
523523
}
524524
__device__ inline unsigned __reduce_max_sync(unsigned __mask,
525525
unsigned __value) {
526-
return __nvvm_redux_sync_umax(__mask, __value);
526+
return __nvvm_redux_sync_umax(__value, __mask);
527527
}
528528
__device__ inline int __reduce_min_sync(unsigned __mask, int __value) {
529-
return __nvvm_redux_sync_min(__mask, __value);
529+
return __nvvm_redux_sync_min(__value, __mask);
530530
}
531531
__device__ inline int __reduce_max_sync(unsigned __mask, int __value) {
532-
return __nvvm_redux_sync_max(__mask, __value);
532+
return __nvvm_redux_sync_max(__value, __mask);
533533
}
534534
__device__ inline unsigned __reduce_or_sync(unsigned __mask, unsigned __value) {
535-
return __nvvm_redux_sync_or(__mask, __value);
535+
return __nvvm_redux_sync_or(__value, __mask);
536536
}
537537
__device__ inline unsigned __reduce_and_sync(unsigned __mask,
538538
unsigned __value) {
539-
return __nvvm_redux_sync_and(__mask, __value);
539+
return __nvvm_redux_sync_and(__value, __mask);
540540
}
541541
__device__ inline unsigned __reduce_xor_sync(unsigned __mask,
542542
unsigned __value) {
543-
return __nvvm_redux_sync_xor(__mask, __value);
543+
return __nvvm_redux_sync_xor(__value, __mask);
544544
}
545545

546546
__device__ inline void __nv_memcpy_async_shared_global_4(void *__dst,

0 commit comments

Comments
 (0)