From 7dae930fe565defd583adc370068a70e2962294e Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Sat, 8 Mar 2025 12:19:51 -0800 Subject: [PATCH] Use `nullptr` in gloo/cuda_allreduce_halving_doubling.h Summary: `nullptr` is preferable to `0` or `NULL`. Let's use it everywhere so we can enable `-Wzero-as-null-pointer-constant`. - If you approve of this diff, please use the "Accept & Ship" button :-) Reviewed By: dtolnay Differential Revision: D70818154 --- gloo/cuda_allreduce_halving_doubling.h | 2 +- gloo/cuda_broadcast_one_to_all.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gloo/cuda_allreduce_halving_doubling.h b/gloo/cuda_allreduce_halving_doubling.h index c4df85c73..04ba7c463 100644 --- a/gloo/cuda_allreduce_halving_doubling.h +++ b/gloo/cuda_allreduce_halving_doubling.h @@ -60,7 +60,7 @@ class CudaAllreduceHalvingDoubling : public Algorithm { void initReductionsAndBroadcasts( typename std::enable_if< std::is_same>::value, - typename U::Pointer>::type* = 0); + typename U::Pointer>::type* = NULL); std::vector> devicePtrs_; std::vector streams_; diff --git a/gloo/cuda_broadcast_one_to_all.h b/gloo/cuda_broadcast_one_to_all.h index 67cac9d47..794691221 100644 --- a/gloo/cuda_broadcast_one_to_all.h +++ b/gloo/cuda_broadcast_one_to_all.h @@ -36,13 +36,13 @@ class CudaBroadcastOneToAll : public Algorithm { void init( typename std::enable_if< std::is_same>::value, - typename U::Pointer>::type* = 0); + typename U::Pointer>::type* = NULL); template void init( typename std::enable_if< std::is_same>::value, - typename U::Pointer>::type* = 0); + typename U::Pointer>::type* = NULL); std::vector> devicePtrs_; std::vector streams_;