From 903b2c01626815fa77b56a5fae9990cac17ff162 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Mon, 6 Aug 2018 10:15:32 +0800 Subject: [PATCH] optimize code --- paddle/fluid/CMakeLists.txt | 2 +- paddle/fluid/framework/operator.cc | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/CMakeLists.txt b/paddle/fluid/CMakeLists.txt index d274d96c29b..e2e26fc5d40 100644 --- a/paddle/fluid/CMakeLists.txt +++ b/paddle/fluid/CMakeLists.txt @@ -6,4 +6,4 @@ add_subdirectory(pybind) add_subdirectory(string) add_subdirectory(recordio) # NOTE: please add subdirectory inference at last. -add_subdirectory(inference) +#add_subdirectory(inference) diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index 18ec226801a..0c8acf71bfa 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -137,11 +137,7 @@ void OperatorBase::Run(const Scope& scope, const platform::Place& place) { #endif } platform::DeviceContextPool& pool = platform::DeviceContextPool::Instance(); - auto* dev_ctx = pool.Get(place); - - // For profiling, don't move out of this function because that will result - // in the failure of multi-GPU profiling. - platform::RecordEvent record_event(Type(), dev_ctx); + platform::RecordEvent record_event(Type(), pool.Get(place)); RunImpl(scope, place); VLOG(10) << "+ " << DebugStringEx(&scope); } -- GitLab