blob: b94a7f0fe7062cbcf4251ecb08cfa1873885a3a3 [file] [log] [blame]
#include "allreduce_ops.h"
#include "gloo/allreduce_ring.h"
#include "gloo/allreduce_ring_chunked.h"
namespace caffe2 {
namespace gloo {
template <typename T, class Context>
void AllreduceOp<T, Context>::initializeRingFull() {
algorithm_.reset(
new ::gloo::AllreduceRing<T>(init_.context, init_.outputs, init_.size));
}
template <typename T, class Context>
void AllreduceOp<T, Context>::initializeRingChunked() {
algorithm_.reset(new ::gloo::AllreduceRingChunked<T>(
init_.context, init_.outputs, init_.size));
}
namespace {
REGISTER_CPU_OPERATOR_WITH_ENGINE(
Allreduce,
GLOO,
AllreduceOp<float, CPUContext>);
} // namespace
} // namespace gloo
} // namespace caffe2