mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
This PR do two things: 1. It moves some Windows warning suppression from various CMake files into the main CMakeList.txt, following the conventions of gcc and clang. 2. It fixes some Windows warnings in the source code. Most importantly, it fixes lots of dll warnings by adjusting C10_API to TORCH_API or TORCH_PYTHON_API. There are still some dll warnings because some TORCH_API functions are actually built as part of libtorch_python Pull Request resolved: https://github.com/pytorch/pytorch/pull/94927 Approved by: https://github.com/malfet
33 lines
773 B
C++
33 lines
773 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);
|
|
};
|
|
|
|
TORCH_DECLARE_SHARED_REGISTRY(
|
|
GlooDeviceRegistry,
|
|
::gloo::transport::Device,
|
|
const std::string&, /* interface */
|
|
const std::string& /* hostname */);
|
|
|
|
} // namespace c10d
|
|
|
|
#endif // USE_C10D_GLOO
|