提交 4e43b713 编写于 作者: Y Yu Yang

Add wait log

上级 dbed1233
...@@ -146,6 +146,7 @@ struct ComputationOpHandle : public OpHandle { ...@@ -146,6 +146,7 @@ struct ComputationOpHandle : public OpHandle {
auto *cur_ctx = dev_ctx_[place_]; auto *cur_ctx = dev_ctx_[place_];
for (auto *in : inputs_) { for (auto *in : inputs_) {
if (in->generated_op_ && in->generated_op_->dev_ctx_[place_] != cur_ctx) { if (in->generated_op_ && in->generated_op_->dev_ctx_[place_] != cur_ctx) {
VLOG(3) << "Wait " << in->generated_op_->DebugString();
in->generated_op_->Wait(cur_ctx); in->generated_op_->Wait(cur_ctx);
} }
} }
...@@ -163,13 +164,9 @@ struct ScaleLossGradOpHandle : public OpHandle { ...@@ -163,13 +164,9 @@ struct ScaleLossGradOpHandle : public OpHandle {
platform::Place place) platform::Place place)
: coeff_(static_cast<float>(1.0 / num_dev)), : coeff_(static_cast<float>(1.0 / num_dev)),
scope_(scope), scope_(scope),
place_(place) { place_(place) {}
cudaSetDevice(boost::get<platform::CUDAPlace>(place_).device);
}
~ScaleLossGradOpHandle() { ~ScaleLossGradOpHandle() {}
cudaSetDevice(boost::get<platform::CUDAPlace>(place_).device);
}
protected: protected:
void RunImpl() override { void RunImpl() override {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册