From 5ce57555ee1a8c26da426acee390a59c65399f63 Mon Sep 17 00:00:00 2001 From: Abhinav Arora Date: Mon, 23 Apr 2018 23:01:49 -0700 Subject: [PATCH] Fix CPPLint issues in init.cc, init.h and library_type.h (#10148) * Fix CPPLint issues in init * Fix compilation * Fix typo in init.cc * Fix CPPLint issues in library_type.h * Fix compilation in init.h --- paddle/fluid/framework/init.cc | 5 +++-- paddle/fluid/framework/init.h | 6 ++++-- paddle/fluid/framework/library_type.h | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/framework/init.cc b/paddle/fluid/framework/init.cc index 75c557fa42..b30f276b4b 100644 --- a/paddle/fluid/framework/init.cc +++ b/paddle/fluid/framework/init.cc @@ -15,6 +15,7 @@ limitations under the License. */ #include #include #include +#include #include "paddle/fluid/framework/init.h" #include "paddle/fluid/framework/operator.h" @@ -28,7 +29,7 @@ namespace framework { std::once_flag gflags_init_flag; std::once_flag p2p_init_flag; -void InitGflags(std::vector &argv) { +void InitGflags(std::vector argv) { std::call_once(gflags_init_flag, [&]() { int argc = argv.size(); char **arr = new char *[argv.size()]; @@ -65,7 +66,7 @@ void InitP2P(int count) { } void InitDevices(bool init_p2p) { - /*Init all avaiable devices by default */ + /*Init all available devices by default */ std::vector places; places.emplace_back(platform::CPUPlace()); diff --git a/paddle/fluid/framework/init.h b/paddle/fluid/framework/init.h index fae98a60b5..1155ca3604 100644 --- a/paddle/fluid/framework/init.h +++ b/paddle/fluid/framework/init.h @@ -12,7 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include +#include // NOLINT +#include +#include #include "gflags/gflags.h" #include "glog/logging.h" @@ -20,7 +22,7 @@ limitations under the License. */ namespace paddle { namespace framework { -void InitGflags(std::vector &argv); +void InitGflags(std::vector argv); void InitGLOG(const std::string &prog_name); diff --git a/paddle/fluid/framework/library_type.h b/paddle/fluid/framework/library_type.h index ea538731b4..904cc01301 100644 --- a/paddle/fluid/framework/library_type.h +++ b/paddle/fluid/framework/library_type.h @@ -14,6 +14,7 @@ limitations under the License. */ #pragma once #include +#include namespace paddle { namespace framework { @@ -67,5 +68,5 @@ inline std::ostream& operator<<(std::ostream& out, LibraryType l) { return out; } -} // namespace -} // framework +} // namespace framework +} // namespace paddle -- GitLab