mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-02 04:31:28 +00:00
connect() APIs changed to return an instance instead of a shared_ptr (#680)
The key purpose is handling all mscclpp objects' memory internally by hiding shared pointers from user APIs. * `Connection` class is now a wrapper of `BaseConnection` class that is equivalent to the previous `Connection` class * `connect()` methods now return `Connection` instead of `std::shared_ptr<Connection>` * Removed `connectOnSetup()` method
This commit is contained in:
@@ -73,13 +73,13 @@ int main() {
|
||||
log("GPU 0: Creating a connection and a semaphore stub ...");
|
||||
|
||||
MSCCLPP_CUDATHROW(cudaSetDevice(0));
|
||||
std::shared_ptr<mscclpp::Connection> conn0 = ctx->connect(/*localEndpoint*/ ep0, /*remoteEndpoint*/ ep1);
|
||||
mscclpp::Connection conn0 = ctx->connect(/*localEndpoint*/ ep0, /*remoteEndpoint*/ ep1);
|
||||
mscclpp::SemaphoreStub semaStub0(conn0);
|
||||
|
||||
log("GPU 1: Creating a connection and a semaphore stub ...");
|
||||
|
||||
MSCCLPP_CUDATHROW(cudaSetDevice(1));
|
||||
std::shared_ptr<mscclpp::Connection> conn1 = ctx->connect(/*localEndpoint*/ ep1, /*remoteEndpoint*/ ep0);
|
||||
mscclpp::Connection conn1 = ctx->connect(/*localEndpoint*/ ep1, /*remoteEndpoint*/ ep0);
|
||||
mscclpp::SemaphoreStub semaStub1(conn1);
|
||||
|
||||
log("GPU 0: Creating a semaphore and a memory channel ...");
|
||||
|
||||
Reference in New Issue
Block a user