提交 fc442ec6 编写于 作者: S superjomn

reformat for cpplint

test=develop
上级 397d0567
......@@ -13,6 +13,10 @@
// limitations under the License.
#pragma once
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "paddle/fluid/lite/core/op_lite.h"
#include "paddle/fluid/lite/core/optimizer.h"
#include "paddle/fluid/lite/core/program.h"
......
......@@ -15,6 +15,9 @@
#pragma once
#include <list>
#include <memory>
#include <utility>
#include <vector>
#include "paddle/fluid/lite/core/kernel.h"
#include "paddle/fluid/lite/core/mir/pass.h"
......
......@@ -14,6 +14,8 @@
#pragma once
#include <memory>
#include <string>
#include "paddle/fluid/inference/analysis/dot.h"
#include "paddle/fluid/lite/core/mir/pass.h"
......
......@@ -15,8 +15,8 @@
#pragma once
#include <list>
#include <map>
#include <memory>
#include <string>
#include "paddle/fluid/lite/core/mir/pass.h"
namespace paddle {
......
......@@ -16,6 +16,8 @@
#include <list>
#include <map>
#include <memory>
#include <set>
#include <stack>
#include <string>
#include <vector>
......
......@@ -14,6 +14,7 @@
#include "paddle/fluid/lite/core/mir/ssa_graph.h"
#include <gtest/gtest.h>
#include <memory>
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/lite/core/mir/graph_visualize_pass.h"
#include "paddle/fluid/lite/core/mir/passes.h"
......
......@@ -14,6 +14,7 @@
#include "paddle/fluid/lite/core/mir/static_kernel_pick_pass.h"
#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
#include "paddle/fluid/lite/core/mir/pass_registry.h"
......
......@@ -15,6 +15,7 @@
#pragma once
#include <limits>
#include <memory>
#include "paddle/fluid/lite/core/mir/pass.h"
#include "paddle/fluid/lite/core/types.h"
......
......@@ -14,6 +14,7 @@
#pragma once
#include <memory>
#include <string>
#include <vector>
#include "paddle/fluid/lite/core/mir/pass.h"
......
......@@ -14,9 +14,12 @@
#pragma once
#include <list>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "paddle/fluid/lite/core/context.h"
#include "paddle/fluid/lite/core/kernel.h"
#include "paddle/fluid/lite/core/scope.h"
......@@ -49,8 +52,9 @@ class OpInfo;
class OpLite : public Registry {
public:
OpLite() = default;
OpLite(const std::string &type) : op_type_(type) {}
OpLite(const std::vector<Place> &valid_places) : valid_places_(valid_places) {
explicit OpLite(const std::string &type) : op_type_(type) {}
explicit OpLite(const std::vector<Place> &valid_places)
: valid_places_(valid_places) {
LOG(INFO) << "valid places " << valid_places.size();
}
......
......@@ -13,6 +13,7 @@
// limitations under the License.
#pragma once
#include <list>
#include <memory>
#include <set>
#include <string>
......
......@@ -15,6 +15,7 @@
#pragma once
#include <iostream>
#include <sstream>
#include <string>
#include "paddle/fluid/lite/utils/cp_logging.h"
#ifdef LITE_WITH_CUDA
#include <cuda.h>
......
......@@ -104,7 +104,7 @@ class DataType {
protected:
// Can only extended by subclass.
DataType(ID id) : id_(id) {}
explicit DataType(ID id) : id_(id) {}
ID id_{ID::Unsupported};
};
......@@ -141,7 +141,7 @@ class Type : public DataType {
TargetType target() const { return place_.target; }
PrecisionType precision() const { return place_.precision; }
DataLayoutType layout() const { return place_.layout; }
short device() const { return place().device; }
int16_t device() const { return place().device; }
const Place& place() const { return place_; }
const std::string& name() const { return name_; }
......@@ -156,7 +156,7 @@ class Type : public DataType {
/// One should avoid using this construct.
Type(ID id, const std::string& name, TargetType target = TargetType::kHost,
PrecisionType precision = PrecisionType::kFloat,
DataLayoutType layout = DataLayoutType::kNCHW, short device = 0)
DataLayoutType layout = DataLayoutType::kNCHW, int16_t device = 0)
: DataType(id), place_{target, precision, layout, device}, name_(name) {}
Place place_;
......@@ -212,7 +212,7 @@ struct ParamType {
const Type* type;
ParamType() = default;
ParamType(const Type* type) : type(type) {}
explicit ParamType(const Type* type) : type(type) {}
std::string DebugString() const { return type->name(); }
};
......
......@@ -31,7 +31,7 @@ class FcOpLite : public OpLite {
public:
FcOpLite() {}
FcOpLite(const std::string &type) : OpLite(type) {}
explicit FcOpLite(const std::string &type) : OpLite(type) {}
bool CheckShape() const override;
......
......@@ -13,6 +13,7 @@
// limitations under the License.
#pragma once
#include <vector>
#include "paddle/fluid/lite/core/compatible_tensor.h"
#include "paddle/fluid/lite/utils/all.h"
......
......@@ -22,6 +22,8 @@
#include <iostream>
#include <sstream>
// NOLINTFILE()
#ifdef LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
// LOG()
......@@ -34,11 +36,9 @@
#define VLOG(level) LOG_INFO.stream()
// CHECK()
// NOLINT
#define CHECK(x) \
if (!(x)) \
paddle::lite::LogMessageFatal(__FILE__, __LINE__).stream() \
<< "Check failed: " #x << ": "
// clang-format off
#define CHECK(x) if (!(x)) paddle::lite::LogMessageFatal(__FILE__, __LINE__).stream() << "Check failed: " #x << ": " // NOLINT(*)
// clang-format on
#define CHECK_EQ(x, y) _CHECK_BINARY(x, ==, y)
#define CHECK_LT(x, y) _CHECK_BINARY(x, <, y)
#define CHECK_LE(x, y) _CHECK_BINARY(x, <=, y)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册