#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: std::vector _comms; std::vector _gpu_worlds; }; class NCCLContext : public DeviceContext { public: explicit NCCLContext(GPUPlace place); virtual ~NCCLContext(); private: std::vector _gpu_ids; std::vector _streams; int root_gpu; }; } }