Skip to content

Commit 7fb8c8a

Browse files
author
Mridul Jain
committed
General Socket Sync
1 parent ff2e413 commit 7fb8c8a

2 files changed

Lines changed: 279 additions & 311 deletions

File tree

‎caffe-distri/src/main/cpp/CaffeNet.cpp‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,19 @@ bool SocketCaffeNet<Dtype>::connect(vector<const char*>& peer_addresses) {
464464
}
465465

466466
#ifndef CPU_ONLY
467+
if(this->solver_mode_== Caffe::GPU) {
467468
//set up syncs[0 ... (local_devices_-1)]
468469
this->syncs_[0].reset(new SocketSync<Dtype>(this->root_solver_,
469470
sockt_channels_,
470471
this->node_rank_));
471472
// Pair devices for map-reduce synchronization
472473
this->syncs_[0]->Prepare(this->local_devices_,
473474
&this->syncs_);
474-
475+
} else {
476+
this->syncs_[0].reset(new SocketSyncCPU<Dtype>(this->root_solver_,
477+
sockt_channels_,
478+
this->node_rank_));
479+
}
475480
#else
476481
this->syncs_[0].reset(new SocketSyncCPU<Dtype>(this->root_solver_,
477482
sockt_channels_,

0 commit comments

Comments
 (0)