| 25 | |
| 26 | namespace { |
| 27 | Status ReductionOp(const string& merge_op, ncclRedOp_t* reduction_op) { |
| 28 | if (merge_op == "Add") { |
| 29 | *reduction_op = ncclSum; |
| 30 | return Status::OK(); |
| 31 | } else if (merge_op == "Mul") { |
| 32 | *reduction_op = ncclProd; |
| 33 | return Status::OK(); |
| 34 | } else { |
| 35 | return errors::Internal("Expected merge_op to be either Add or Mul, found ", |
| 36 | merge_op); |
| 37 | } |
| 38 | } |
| 39 | } // namespace |
| 40 | |
| 41 | void NcclReducer::Run(StatusCallback done) { |