From 99f85a9fbc704424ab99a0327d09f49d46f82be0 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Mon, 19 Mar 2018 20:35:07 +0800 Subject: [PATCH] Set dev --- paddle/fluid/framework/parallel_executor.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 1a2e6a5f8..b78dc3b8a 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -131,6 +131,7 @@ struct ScaleLossGradOpHandle : public OpHandle { : coeff_(static_cast(1.0 / num_dev)), scope_(scope), place_(place) { + cudaSetDevice(boost::get(place_).device); PADDLE_ENFORCE(cudaEventCreateWithFlags(&ev_, cudaEventDisableTiming)); VLOG(3) << "Create " << ev_; } -- GitLab