未验证 提交 4776f8f4 编写于 作者: 石晓伟 提交者: GitHub

cpp namespace alias, test=develop (#3894)

上级 627091df
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "lite/core/program.h" #include "lite/core/program.h"
#include "lite/core/scope.h" #include "lite/core/scope.h"
#include "lite/core/types.h" #include "lite/core/types.h"
#include "lite/model_parser/cpp/op_desc.h" #include "lite/model_parser/cpp_desc.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "lite/core/mir/pass.h" #include "lite/core/mir/pass.h"
#include "lite/core/mir/pass_registry.h" #include "lite/core/mir/pass_registry.h"
#include "lite/core/mir/pattern_matcher.h" #include "lite/core/mir/pattern_matcher.h"
#include "lite/model_parser/cpp/var_desc.h" #include "lite/model_parser/cpp_desc.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "lite/api/paddle_use_passes.h" #include "lite/api/paddle_use_passes.h"
#include "lite/core/mir/ssa_graph.h" #include "lite/core/mir/ssa_graph.h"
#include "lite/core/program.h" #include "lite/core/program.h"
#include "lite/model_parser/cpp/program_desc.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/model_parser/model_parser.h" #include "lite/model_parser/model_parser.h"
DEFINE_string(model_dir, "", "model_dir"); DEFINE_string(model_dir, "", "model_dir");
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "lite/core/context.h" #include "lite/core/context.h"
#include "lite/core/kernel.h" #include "lite/core/kernel.h"
#include "lite/core/scope.h" #include "lite/core/scope.h"
#include "lite/model_parser/cpp/op_desc.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/operators/op_params.h" #include "lite/operators/op_params.h"
namespace paddle { namespace paddle {
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
#include "lite/core/program.h" #include "lite/core/program.h"
#include <algorithm> #include <algorithm>
#include <map> #include <map>
#include "lite/model_parser/cpp/block_desc.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/model_parser/cpp/op_desc.h"
#include "lite/model_parser/cpp/var_desc.h"
#include "lite/operators/conditional_block_op.h" #include "lite/operators/conditional_block_op.h"
#include "lite/operators/subgraph_op.h" #include "lite/operators/subgraph_op.h"
#include "lite/operators/while_op.h" #include "lite/operators/while_op.h"
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "lite/core/kernel.h" #include "lite/core/kernel.h"
#include "lite/core/op_lite.h" #include "lite/core/op_lite.h"
#include "lite/core/op_registry.h" #include "lite/core/op_registry.h"
#include "lite/model_parser/cpp/program_desc.h" #include "lite/model_parser/cpp_desc.h"
#ifdef LITE_WITH_PROFILE #ifdef LITE_WITH_PROFILE
#include "lite/core/profile/profiler.h" #include "lite/core/profile/profiler.h"
#endif #endif
......
...@@ -59,7 +59,7 @@ void Module::AddHeaderIncludeGenCode() { ...@@ -59,7 +59,7 @@ void Module::AddHeaderIncludeGenCode() {
Line("#include \"lite/gen_code/paddle_infer.h\""); Line("#include \"lite/gen_code/paddle_infer.h\"");
Line("#include \"lite/core/op_registry.h\""); Line("#include \"lite/core/op_registry.h\"");
Line("#include \"lite/core/scope.h\""); Line("#include \"lite/core/scope.h\"");
Line("#include \"lite/model_parser/cpp/op_desc.h\""); Line("#include \"lite/model_parser/cpp_desc.h\"");
Line(""); Line("");
Line(""); Line("");
} }
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
#include "lite/core/program.h" #include "lite/core/program.h"
#include "lite/core/target_wrapper.h" #include "lite/core/target_wrapper.h"
#include "lite/core/tensor.h" #include "lite/core/tensor.h"
#include "lite/model_parser/base/apis.h"
#include "lite/model_parser/compatible_pb.h" #include "lite/model_parser/compatible_pb.h"
#include "lite/model_parser/cpp/op_desc.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/model_parser/desc_apis.h"
#include "lite/model_parser/pb/op_desc.h" #include "lite/model_parser/pb/op_desc.h"
#include "lite/utils/all.h" #include "lite/utils/all.h"
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "lite/core/scope.h" #include "lite/core/scope.h"
#include "lite/core/tensor.h" #include "lite/core/tensor.h"
#include "lite/model_parser/compatible_pb.h" #include "lite/model_parser/compatible_pb.h"
#include "lite/model_parser/cpp/op_desc.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/model_parser/model_parser.h" #include "lite/model_parser/model_parser.h"
#include "lite/model_parser/pb/program_desc.h" #include "lite/model_parser/pb/program_desc.h"
......
if (NOT LITE_ON_TINY_PUBLISH) if (NOT LITE_ON_TINY_PUBLISH)
add_subdirectory(pb) add_subdirectory(pb)
endif() endif()
add_subdirectory(cpp) add_subdirectory(general)
add_subdirectory(naive_buffer) add_subdirectory(naive_buffer)
add_subdirectory(flatbuffers) add_subdirectory(flatbuffers)
......
...@@ -20,10 +20,7 @@ ...@@ -20,10 +20,7 @@
#include "lite/model_parser/naive_buffer/program_desc.h" #include "lite/model_parser/naive_buffer/program_desc.h"
#include "lite/model_parser/naive_buffer/var_desc.h" #include "lite/model_parser/naive_buffer/var_desc.h"
#ifndef LITE_ON_TINY_PUBLISH #ifndef LITE_ON_TINY_PUBLISH
#include "lite/model_parser/cpp/block_desc.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/model_parser/cpp/op_desc.h"
#include "lite/model_parser/cpp/program_desc.h"
#include "lite/model_parser/cpp/var_desc.h"
#endif #endif
namespace paddle { namespace paddle {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <set> #include <set>
#include <string> #include <string>
#include "lite/api/paddle_place.h" #include "lite/api/paddle_place.h"
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
......
...@@ -17,10 +17,7 @@ ...@@ -17,10 +17,7 @@
#include "lite/api/paddle_lite_factory_helper.h" #include "lite/api/paddle_lite_factory_helper.h"
#include "lite/model_parser/compatible_pb.h" #include "lite/model_parser/compatible_pb.h"
#include "lite/model_parser/cpp/block_desc.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/model_parser/cpp/op_desc.h"
#include "lite/model_parser/cpp/program_desc.h"
#include "lite/model_parser/cpp/var_desc.h"
USE_LITE_KERNEL(leaky_relu, kCUDA, kFloat, kNCHW, def); USE_LITE_KERNEL(leaky_relu, kCUDA, kFloat, kNCHW, def);
......
...@@ -21,10 +21,7 @@ ...@@ -21,10 +21,7 @@
* lite::pb::XXDesc/lite::naive_buffer::XXDesc. * lite::pb::XXDesc/lite::naive_buffer::XXDesc.
*/ */
#include "lite/model_parser/cpp/block_desc.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/model_parser/cpp/op_desc.h"
#include "lite/model_parser/cpp/program_desc.h"
#include "lite/model_parser/cpp/var_desc.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
......
...@@ -14,10 +14,7 @@ ...@@ -14,10 +14,7 @@
#include "lite/model_parser/compatible_pb.h" #include "lite/model_parser/compatible_pb.h"
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "lite/model_parser/cpp/block_desc.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/model_parser/cpp/op_desc.h"
#include "lite/model_parser/cpp/program_desc.h"
#include "lite/model_parser/cpp/var_desc.h"
#include "lite/model_parser/naive_buffer/block_desc.h" #include "lite/model_parser/naive_buffer/block_desc.h"
#include "lite/model_parser/naive_buffer/op_desc.h" #include "lite/model_parser/naive_buffer/op_desc.h"
#include "lite/model_parser/naive_buffer/program_desc.h" #include "lite/model_parser/naive_buffer/program_desc.h"
......
// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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 "lite/model_parser/general/block_desc.h"
#include "lite/model_parser/general/op_desc.h"
#include "lite/model_parser/general/program_desc.h"
#include "lite/model_parser/general/var_desc.h"
namespace paddle {
namespace lite {
namespace cpp = general;
}
}
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
// 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.
#include "lite/model_parser/cpp/block_desc.h" #include "lite/model_parser/general/block_desc.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
namespace cpp { namespace general {
template <> template <>
VarDesc* BlockDesc::GetVar<VarDesc>(int32_t idx) { VarDesc* BlockDesc::GetVar<VarDesc>(int32_t idx) {
...@@ -42,6 +42,6 @@ OpDesc* BlockDesc::AddOp<OpDesc>() { ...@@ -42,6 +42,6 @@ OpDesc* BlockDesc::AddOp<OpDesc>() {
return &ops_.back(); return &ops_.back();
} }
} // namespace cpp } // namespace general
} // namespace lite } // namespace lite
} // namespace paddle } // namespace paddle
...@@ -14,16 +14,17 @@ ...@@ -14,16 +14,17 @@
#pragma once #pragma once
#include <vector> #include <vector>
#include "lite/model_parser/cpp/op_desc.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/cpp/var_desc.h" #include "lite/model_parser/general/op_desc.h"
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/general/var_desc.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
namespace cpp { namespace general {
/* /*
* The cpp::BlockDesc is the internal representation for Op. All the internal * The general::BlockDesc is the internal representation for Op. All the
* internal
* imprementation should use it, not the pb::BlockDesc. * imprementation should use it, not the pb::BlockDesc.
*/ */
class BlockDesc : public BlockDescAPI { class BlockDesc : public BlockDescAPI {
...@@ -82,6 +83,6 @@ class BlockDesc : public BlockDescAPI { ...@@ -82,6 +83,6 @@ class BlockDesc : public BlockDescAPI {
int32_t forward_block_idx_; int32_t forward_block_idx_;
}; };
} // namespace cpp } // namespace general
} // namespace lite } // namespace lite
} // namespace paddle } // namespace paddle
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
// 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.
#include "lite/model_parser/cpp/op_desc.h" #include "lite/model_parser/general/op_desc.h"
#include <set> #include <set>
#include <utility> #include <utility>
namespace paddle { namespace paddle {
namespace lite { namespace lite {
namespace cpp { namespace general {
std::vector<std::string> OpDesc::OutputArgumentNames() const { std::vector<std::string> OpDesc::OutputArgumentNames() const {
std::vector<std::string> res; std::vector<std::string> res;
...@@ -69,6 +69,6 @@ bool OpDesc::HasOutput(const std::string& param) const { ...@@ -69,6 +69,6 @@ bool OpDesc::HasOutput(const std::string& param) const {
return it != outputs_.end(); return it != outputs_.end();
} }
} // namespace cpp } // namespace general
} // namespace lite } // namespace lite
} // namespace paddle } // namespace paddle
...@@ -17,16 +17,16 @@ ...@@ -17,16 +17,16 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/utils/any.h" #include "lite/utils/any.h"
#include "lite/utils/varient.h" #include "lite/utils/varient.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
namespace cpp { namespace general {
/* /*
* The cpp::OpDesc is the internal representation for Op. All the internal * The general::OpDesc is the internal representation for Op. All the internal
* imprementation should use it, not the pb::OpDesc. * imprementation should use it, not the pb::OpDesc.
*/ */
class OpDesc : public OpDescAPI { class OpDesc : public OpDescAPI {
...@@ -131,6 +131,6 @@ class OpDesc : public OpDescAPI { ...@@ -131,6 +131,6 @@ class OpDesc : public OpDescAPI {
} }
}; };
} // namespace cpp } // namespace general
} // namespace lite } // namespace lite
} // namespace paddle } // namespace paddle
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
// 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.
#include "lite/model_parser/cpp/program_desc.h" #include "lite/model_parser/general/program_desc.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
namespace cpp { namespace general {
template <> template <>
BlockDesc* ProgramDesc::GetBlock<BlockDesc>(int32_t idx) { BlockDesc* ProgramDesc::GetBlock<BlockDesc>(int32_t idx) {
...@@ -30,6 +30,6 @@ BlockDesc* ProgramDesc::AddBlock<BlockDesc>() { ...@@ -30,6 +30,6 @@ BlockDesc* ProgramDesc::AddBlock<BlockDesc>() {
return &blocks_.back(); return &blocks_.back();
} }
} // namespace cpp } // namespace general
} // namespace lite } // namespace lite
} // namespace paddle } // namespace paddle
...@@ -14,15 +14,16 @@ ...@@ -14,15 +14,16 @@
#pragma once #pragma once
#include <vector> #include <vector>
#include "lite/model_parser/cpp/block_desc.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/general/block_desc.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
namespace cpp { namespace general {
/* /*
* The cpp::ProgramDesc is the internal representation for Op. All the internal * The general::ProgramDesc is the internal representation for Op. All the
* internal
* imprementation should use it, not the pb::ProgramDesc. * imprementation should use it, not the pb::ProgramDesc.
*/ */
class ProgramDesc : public ProgramDescAPI { class ProgramDesc : public ProgramDescAPI {
...@@ -59,6 +60,6 @@ class ProgramDesc : public ProgramDescAPI { ...@@ -59,6 +60,6 @@ class ProgramDesc : public ProgramDescAPI {
std::vector<BlockDesc> blocks_; std::vector<BlockDesc> blocks_;
}; };
} // namespace cpp } // namespace general
} // namespace lite } // namespace lite
} // namespace paddle } // namespace paddle
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
// 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.
#include "lite/model_parser/cpp/var_desc.h" #include "lite/model_parser/general/var_desc.h"
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
#pragma once #pragma once
#include <string> #include <string>
#include <vector> #include <vector>
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
namespace paddle { namespace paddle {
namespace lite { namespace lite {
namespace cpp { namespace general {
/* /*
* The cpp::VarDesc is the internal representation for Op. All the internal * The general::VarDesc is the internal representation for Op. All the internal
* imprementation should use it, not the pb::VarDesc. * imprementation should use it, not the pb::VarDesc.
*/ */
class VarDesc : public VarDescAPI { class VarDesc : public VarDescAPI {
...@@ -59,6 +59,6 @@ class VarDesc : public VarDescAPI { ...@@ -59,6 +59,6 @@ class VarDesc : public VarDescAPI {
std::vector<int64_t> shape_; std::vector<int64_t> shape_;
}; };
} // namespace cpp } // namespace general
} // namespace lite } // namespace lite
} // namespace paddle } // namespace paddle
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "lite/core/tensor.h" #include "lite/core/tensor.h"
#include "lite/core/variable.h" #include "lite/core/variable.h"
#include "lite/core/version.h" #include "lite/core/version.h"
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/naive_buffer/combined_params_desc.h" #include "lite/model_parser/naive_buffer/combined_params_desc.h"
#include "lite/model_parser/naive_buffer/param_desc.h" #include "lite/model_parser/naive_buffer/param_desc.h"
#include "lite/model_parser/naive_buffer/program_desc.h" #include "lite/model_parser/naive_buffer/program_desc.h"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#include <vector> #include <vector>
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/naive_buffer/proto/framework.nb.h" #include "lite/model_parser/naive_buffer/proto/framework.nb.h"
namespace paddle { namespace paddle {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#include <vector> #include <vector>
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/naive_buffer/param_desc.h" #include "lite/model_parser/naive_buffer/param_desc.h"
#include "lite/model_parser/naive_buffer/proto/framework.nb.h" #include "lite/model_parser/naive_buffer/proto/framework.nb.h"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <set> #include <set>
#include <string> #include <string>
#include <vector> #include <vector>
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/naive_buffer/proto/framework.nb.h" #include "lite/model_parser/naive_buffer/proto/framework.nb.h"
namespace paddle { namespace paddle {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#include <vector> #include <vector>
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/naive_buffer/proto/framework.nb.h" #include "lite/model_parser/naive_buffer/proto/framework.nb.h"
namespace paddle { namespace paddle {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#pragma once #pragma once
#include <vector> #include <vector>
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/naive_buffer/proto/framework.nb.h" #include "lite/model_parser/naive_buffer/proto/framework.nb.h"
namespace paddle { namespace paddle {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#include <vector> #include <vector>
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/naive_buffer/naive_buffer_wrapper_helper.h" #include "lite/model_parser/naive_buffer/naive_buffer_wrapper_helper.h"
#include "lite/model_parser/naive_buffer/proto/framework.nb.h" #include "lite/model_parser/naive_buffer/proto/framework.nb.h"
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <vector> #include <vector>
#include "lite/core/framework.pb.h" #include "lite/core/framework.pb.h"
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/utils/cp_logging.h" #include "lite/utils/cp_logging.h"
namespace paddle { namespace paddle {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "lite/core/framework.pb.h" #include "lite/core/framework.pb.h"
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/utils/all.h" #include "lite/utils/all.h"
namespace paddle { namespace paddle {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <vector> #include <vector>
#include "lite/core/framework.pb.h" #include "lite/core/framework.pb.h"
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/utils/cp_logging.h" #include "lite/utils/cp_logging.h"
namespace paddle { namespace paddle {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "lite/core/framework.pb.h" #include "lite/core/framework.pb.h"
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/base/apis.h"
#include "lite/utils/cp_logging.h" #include "lite/utils/cp_logging.h"
namespace paddle { namespace paddle {
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include "lite/core/scope.h" #include "lite/core/scope.h"
#include "lite/core/tensor.h" #include "lite/core/tensor.h"
#include "lite/core/types.h" #include "lite/core/types.h"
#include "lite/model_parser/cpp/block_desc.h" #include "lite/model_parser/base/apis.h"
#include "lite/model_parser/desc_apis.h" #include "lite/model_parser/cpp_desc.h"
#include "lite/utils/all.h" #include "lite/utils/all.h"
/* /*
* This file contains all the argument parameter data structure for operators. * This file contains all the argument parameter data structure for operators.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册