mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-08 07:39:33 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/60543 Since now c10d is part of libtorch, it would also be nice if the sources lived all in one place. ghstack-source-id: 132306292 Test Plan: It builds Reviewed By: cbalioglu Differential Revision: D29062002 fbshipit-source-id: d9e1301e9d73e1643fa0f0119cd2d618f1ad52e6
33 lines
771 B
C++
33 lines
771 B
C++
#pragma once
|
|
|
|
#ifdef USE_C10D_GLOO
|
|
|
|
#include <string>
|
|
|
|
#include <c10/util/Registry.h>
|
|
#include <gloo/config.h>
|
|
#include <gloo/transport/device.h>
|
|
|
|
namespace c10d {
|
|
|
|
class TORCH_API GlooDeviceFactory {
|
|
public:
|
|
// Create new device instance for specific interface.
|
|
static std::shared_ptr<::gloo::transport::Device> makeDeviceForInterface(
|
|
const std::string& interface);
|
|
|
|
// Create new device instance for specific hostname or address.
|
|
static std::shared_ptr<::gloo::transport::Device> makeDeviceForHostname(
|
|
const std::string& hostname);
|
|
};
|
|
|
|
C10_DECLARE_SHARED_REGISTRY(
|
|
GlooDeviceRegistry,
|
|
::gloo::transport::Device,
|
|
const std::string&, /* interface */
|
|
const std::string& /* hostname */);
|
|
|
|
} // namespace c10d
|
|
|
|
#endif // USE_C10D_GLOO
|