Fix build issue with nccl 2.1 or older
@@ -152,6 +152,15 @@ ncclDataType_t _get_proper_datatype(ncclDataType_t datatype) {
#endif // #if (NCCL_VERSION_CODE < 2000)
+#if (NCCL_VERSION_CODE < 2200)
+// New function in 2.2
+ncclResult_t ncclBroadcast(const void* sendbuff, void* recvbuff, size_t count,
+ ncclDataType_t datatype, int root, ncclComm_t comm,
+ cudaStream_t stream) {
+ return ncclSuccess;
+}
+#endif // #if (NCCL_VERSION_CODE < 2200)
+
#if (NCCL_VERSION_CODE < 2304)
ncclResult_t ncclGetVersion(int *version) {
@@ -161,7 +170,6 @@ ncclResult_t ncclGetVersion(int *version) {
#endif // #if (NCCL_VERSION_CODE < 2304)
-
ncclResult_t _ncclAllReduce(const void* sendbuff, void* recvbuff, size_t count,
ncclDataType_t datatype, ncclRedOp_t op, ncclComm_t comm,
cudaStream_t stream) {
@@ -222,14 +230,4 @@ void ncclCommAbort(ncclComm_t comm) {
}
#endif
-#if (NCCL_VERSION_CODE < 2200)
-// New function in 2.2
-ncclResult_t ncclBroadcast(const void* sendbuff, void* recvbuff, size_t count,
- ncclDataType_t datatype, int root, ncclComm_t comm,
- cudaStream_t stream) {
- return ncclSuccess;
-}
-#endif
-
-
#endif // #ifndef INCLUDE_GUARD_CUPY_NCCL_H
