未验证 提交 5ce57555 编写于 作者: A Abhinav Arora 提交者: GitHub

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
上级 ba97194c
...@@ -15,6 +15,7 @@ limitations under the License. */ ...@@ -15,6 +15,7 @@ limitations under the License. */
#include <algorithm> #include <algorithm>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <vector>
#include "paddle/fluid/framework/init.h" #include "paddle/fluid/framework/init.h"
#include "paddle/fluid/framework/operator.h" #include "paddle/fluid/framework/operator.h"
...@@ -28,7 +29,7 @@ namespace framework { ...@@ -28,7 +29,7 @@ namespace framework {
std::once_flag gflags_init_flag; std::once_flag gflags_init_flag;
std::once_flag p2p_init_flag; std::once_flag p2p_init_flag;
void InitGflags(std::vector<std::string> &argv) { void InitGflags(std::vector<std::string> argv) {
std::call_once(gflags_init_flag, [&]() { std::call_once(gflags_init_flag, [&]() {
int argc = argv.size(); int argc = argv.size();
char **arr = new char *[argv.size()]; char **arr = new char *[argv.size()];
...@@ -65,7 +66,7 @@ void InitP2P(int count) { ...@@ -65,7 +66,7 @@ void InitP2P(int count) {
} }
void InitDevices(bool init_p2p) { void InitDevices(bool init_p2p) {
/*Init all avaiable devices by default */ /*Init all available devices by default */
std::vector<platform::Place> places; std::vector<platform::Place> places;
places.emplace_back(platform::CPUPlace()); places.emplace_back(platform::CPUPlace());
......
...@@ -12,7 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -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 See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#pragma once #pragma once
#include <mutex> #include <mutex> // NOLINT
#include <string>
#include <vector>
#include "gflags/gflags.h" #include "gflags/gflags.h"
#include "glog/logging.h" #include "glog/logging.h"
...@@ -20,7 +22,7 @@ limitations under the License. */ ...@@ -20,7 +22,7 @@ limitations under the License. */
namespace paddle { namespace paddle {
namespace framework { namespace framework {
void InitGflags(std::vector<std::string> &argv); void InitGflags(std::vector<std::string> argv);
void InitGLOG(const std::string &prog_name); void InitGLOG(const std::string &prog_name);
......
...@@ -14,6 +14,7 @@ limitations under the License. */ ...@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once #pragma once
#include <cctype> #include <cctype>
#include <string>
namespace paddle { namespace paddle {
namespace framework { namespace framework {
...@@ -67,5 +68,5 @@ inline std::ostream& operator<<(std::ostream& out, LibraryType l) { ...@@ -67,5 +68,5 @@ inline std::ostream& operator<<(std::ostream& out, LibraryType l) {
return out; return out;
} }
} // namespace } // namespace framework
} // framework } // namespace paddle
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册