@@ -236,8 +236,9 @@ static inline int check_restrictions(gpudata *src, size_t offsrc,
236236static int reduce (gpudata * src , size_t offsrc , gpudata * dest , size_t offdest ,
237237 size_t count , int typecode , int opcode , int root ,
238238 gpucomm * comm ) {
239- ncclRedOp_t op ;
240- ncclDataType_t datatype ;
239+ // need dummy init so that compiler shuts up
240+ ncclRedOp_t op = nccl_NUM_OPS ;
241+ ncclDataType_t datatype = nccl_NUM_TYPES ;
241242 gpudata * dst = NULL ;
242243 int rank = 0 ;
243244 cuda_context * ctx ;
@@ -285,8 +286,9 @@ static int reduce(gpudata *src, size_t offsrc, gpudata *dest, size_t offdest,
285286static int all_reduce (gpudata * src , size_t offsrc , gpudata * dest ,
286287 size_t offdest , size_t count , int typecode , int opcode ,
287288 gpucomm * comm ) {
288- ncclRedOp_t op ;
289- ncclDataType_t datatype ;
289+ // need dummy init so that compiler shuts up
290+ ncclRedOp_t op = nccl_NUM_OPS ;
291+ ncclDataType_t datatype = nccl_NUM_TYPES ;
290292 cuda_context * ctx ;
291293
292294 ASSERT_BUF (src );
@@ -322,8 +324,9 @@ static int all_reduce(gpudata *src, size_t offsrc, gpudata *dest,
322324static int reduce_scatter (gpudata * src , size_t offsrc , gpudata * dest ,
323325 size_t offdest , size_t count , int typecode ,
324326 int opcode , gpucomm * comm ) {
325- ncclRedOp_t op ;
326- ncclDataType_t datatype ;
327+ // need dummy init so that compiler shuts up
328+ ncclRedOp_t op = nccl_NUM_OPS ;
329+ ncclDataType_t datatype = nccl_NUM_TYPES ;
327330 int ndev = 0 ;
328331 size_t resc_size ;
329332 cuda_context * ctx ;
@@ -367,7 +370,8 @@ static int reduce_scatter(gpudata *src, size_t offsrc, gpudata *dest,
367370 */
368371static int broadcast (gpudata * array , size_t offset , size_t count , int typecode ,
369372 int root , gpucomm * comm ) {
370- ncclDataType_t datatype ;
373+ // need dummy init so that compiler shuts up
374+ ncclDataType_t datatype = nccl_NUM_TYPES ;
371375 int rank = 0 ;
372376 cuda_context * ctx ;
373377
@@ -406,7 +410,8 @@ static int broadcast(gpudata *array, size_t offset, size_t count, int typecode,
406410static int all_gather (gpudata * src , size_t offsrc , gpudata * dest ,
407411 size_t offdest , size_t count , int typecode ,
408412 gpucomm * comm ) {
409- ncclDataType_t datatype ;
413+ // need dummy init so that compiler shuts up
414+ ncclDataType_t datatype = nccl_NUM_TYPES ;
410415 int ndev = 0 ;
411416 size_t resc_size ;
412417 cuda_context * ctx ;
0 commit comments