#pragma once #include #include "paddle/platform/device_context.h" namespace paddle { namespace platform { class NCCLManager { public: static NCCLManager* Get() { static NCCLManager m; return &m; } NCCLManager() { _comms.resize(_gpu_worlds.size()); } ~NCCLManager() {} private: // clang-format off std::vector _comms; std::vector _gpu_worlds; // clang-format on }; class NCCLContext : public DeviceContext { public: explicit NCCLContext(GPUPlace place); virtual ~NCCLContext(); private: // clang-format off std::vector _gpu_ids; std::vector _streams; int root_gpu; // clang-format on }; } }