helinwang-patch-1
Yu Yang 7 years ago
parent d26f093f9d
commit 99f85a9fbc

@ -131,6 +131,7 @@ struct ScaleLossGradOpHandle : public OpHandle {
: 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);
PADDLE_ENFORCE(cudaEventCreateWithFlags(&ev_, cudaEventDisableTiming)); PADDLE_ENFORCE(cudaEventCreateWithFlags(&ev_, cudaEventDisableTiming));
VLOG(3) << "Create " << ev_; VLOG(3) << "Create " << ev_;
} }

Loading…
Cancel
Save