未验证 提交 3e4c4d91 编写于 作者: G gouzil 提交者: GitHub

[CodeStyle][CINN] fix cinn cpplint codestyle 50-55 (#55021)

上级 f71e6a41
......@@ -23,7 +23,7 @@
namespace cinn {
namespace common {
const static std::vector<std::string> kAxises({
static const std::vector<std::string> kAxises({
"i", // level 0
"j", // level 1
"k", // level 2
......
......@@ -476,7 +476,7 @@ std::shared_ptr<OpStrategy> StrategyForAssignValue(
absl::get<std::vector<TYPE>>(value), out_type[0], tensor_name); \
}
if (false) {
if (false) { // NOLINT
}
EXPAND_ATTR_TYPE(EXPAND_VALUE_TO_TENSOR)
else {
......@@ -517,7 +517,7 @@ std::vector<shape_t> InferShapeForAssignValue(
shape.emplace_back(absl::get<std::vector<TYPE>>(value).size()); \
}
if (false) {
if (false) { // NOLINT
}
EXPAND_ATTR_TYPE(EXPAND_ATTR_TO_GET_SHAPE)
else {
......@@ -558,7 +558,7 @@ std::vector<Type> InferDtypeForAssignValue(
out_type = common::type_of<TYPE>(); \
}
if (false) {
if (false) { // NOLINT
}
EXPAND_ATTR_TYPE(EXPAND_ATTR_TO_GET_DTYPE)
else {
......
......@@ -80,8 +80,8 @@ class AssertMsg {
class CheckFusionAccuracyPass {
public:
CheckFusionAccuracyPass(Graph* graph_)
: graph_(graph_),
CheckFusionAccuracyPass(Graph* graph)
: graph_(graph),
shape_dict_(graph_->GetMutableAttrs<ShapeDict>("infershape")),
dtype_dict_(graph_->GetMutableAttrs<DtypeDict>("inferdtype")) {}
......
......@@ -935,7 +935,6 @@ void BindFrontend(pybind11::module *m) {
<< " in CINN! Please check.";
return self.var_model_to_program_map().at(paddle_name);
});
} // namespace frontend
#undef EXPAND_CINN_SUPPORT_TYPE
......
......@@ -193,7 +193,7 @@ void BindCinnRuntime(py::module *m) {
.def_readwrite("flag", &cinn_buffer_t::flag)
.def_readwrite("type", &cinn_buffer_t::type)
.def_readwrite("dimensions", &cinn_buffer_t::dimensions)
//.def_readwrite("dims", &cinn_buffer_t::dims)
// .def_readwrite("dims", &cinn_buffer_t::dims)
.def_readwrite("lazy", &cinn_buffer_t::lazy)
.def_readwrite("memory_size", &cinn_buffer_t::memory_size)
.def_readwrite("align", &cinn_buffer_t::align)
......@@ -228,7 +228,7 @@ void BindCinnRuntime(py::module *m) {
m->def("cinn_x86_device_interface", &cinn_x86_device_interface)
.def("cinn_buffer_load_float32", &cinn_buffer_load_float32)
.def("cinn_buffer_load_float64", &cinn_buffer_load_float64);
//.def("cinn_buffer_slice", &cinn_buffer_slice,
// .def("cinn_buffer_slice", &cinn_buffer_slice,
// py::return_value_policy::reference);
py::class_<cinn_value_t> cinn_value(*m, "cinn_value_t");
......
......@@ -101,7 +101,8 @@ void cinn_call_cuda_kernel(void *kernel_fn,
cinn_pod_value_t *args = static_cast<cinn_pod_value_t *>(v_args);
for (int idx = 0; idx < num_args; ++idx) {
if (args[idx].type_code() == ::cinn_type_code<cinn_buffer_t *>()) {
kernel_args.emplace_back(&((cinn_buffer_t *)(args[idx]))->memory);
kernel_args.emplace_back(
&((cinn_buffer_t *)(args[idx]))->memory); // NOLINT
} else {
kernel_args.emplace_back(args[idx].data_addr());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册