diff --git a/mindspore/lite/nnacl/fp32/prelu_fp32.c b/mindspore/lite/nnacl/fp32/prelu_fp32.c index c75ad0235c..e2caa6a6cd 100644 --- a/mindspore/lite/nnacl/fp32/prelu_fp32.c +++ b/mindspore/lite/nnacl/fp32/prelu_fp32.c @@ -16,7 +16,7 @@ #include "nnacl/fp32/prelu_fp32.h" #ifdef ENABLE_ARM64 -inline void PRelu4x16(const float *in, float *out, float *cur_slope, size_t step) { +static inline void PRelu4x16(const float *in, float *out, float *cur_slope, size_t step) { asm volatile( "mov x10, %[in]\n" "mov x11, %[out]\n" diff --git a/mindspore/lite/src/cxx_api/cell.cc b/mindspore/lite/src/cxx_api/cell.cc index 503b1995b6..96dd271634 100644 --- a/mindspore/lite/src/cxx_api/cell.cc +++ b/mindspore/lite/src/cxx_api/cell.cc @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include "include/api/cell.h" #include "include/api/lite_context.h" #include "src/common/log_adapter.h" namespace mindspore { - class GraphImpl {}; std::vector CellBase::operator()(const std::vector &inputs) const { @@ -92,5 +92,4 @@ InputAndOutput::InputAndOutput(const std::shared_ptr &cell, const std: : index_(-1) { MS_LOG(ERROR) << "Unsupported feature."; } - } // namespace mindspore diff --git a/mindspore/lite/src/cxx_api/graph/graph.cc b/mindspore/lite/src/cxx_api/graph/graph.cc index e1c57cdeff..cfce2b857b 100644 --- a/mindspore/lite/src/cxx_api/graph/graph.cc +++ b/mindspore/lite/src/cxx_api/graph/graph.cc @@ -19,7 +19,6 @@ #include "src/cxx_api/graph/graph_data.h" namespace mindspore { - Graph::Graph(const std::shared_ptr &graph_data) : graph_data_(graph_data) {} Graph::Graph(std::shared_ptr &&graph_data) : graph_data_(graph_data) {} diff --git a/mindspore/lite/src/cxx_api/graph/graph_data.h b/mindspore/lite/src/cxx_api/graph/graph_data.h index 584035db8d..218a8a36c2 100644 --- a/mindspore/lite/src/cxx_api/graph/graph_data.h +++ b/mindspore/lite/src/cxx_api/graph/graph_data.h @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef MINDSPORE_LITE_SRC_CXX_API_GRAPH_GRAPH_DATA_H #define MINDSPORE_LITE_SRC_CXX_API_GRAPH_GRAPH_DATA_H @@ -39,4 +40,5 @@ class Graph::GraphData { std::shared_ptr lite_model_; }; } // namespace mindspore + #endif // MINDSPORE_LITE_SRC_CXX_API_GRAPH_GRAPH_DATA_H diff --git a/mindspore/lite/src/cxx_api/lite_context.cc b/mindspore/lite/src/cxx_api/lite_context.cc index cc5f646a01..9dcc424443 100644 --- a/mindspore/lite/src/cxx_api/lite_context.cc +++ b/mindspore/lite/src/cxx_api/lite_context.cc @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include "include/api/lite_context.h" #include #include @@ -21,7 +22,6 @@ #include "src/common/log_adapter.h" namespace mindspore { - constexpr char kVendorName[] = "vendor_name"; constexpr char kThreadNum[] = "thread_name"; constexpr char kAllocator[] = "allocator"; @@ -299,5 +299,4 @@ int Context::GetNPUFrequency(const std::shared_ptr &context) { } return 3; } - } // namespace mindspore diff --git a/mindspore/lite/src/cxx_api/model/model.cc b/mindspore/lite/src/cxx_api/model/model.cc index f94aa367c6..86e948598e 100644 --- a/mindspore/lite/src/cxx_api/model/model.cc +++ b/mindspore/lite/src/cxx_api/model/model.cc @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include "include/api/model.h" #include "include/api/lite_context.h" #include "src/cxx_api/model/model_impl.h" #include "src/common/log_adapter.h" namespace mindspore { - Status Model::Build() { if (impl_ == nullptr) { MS_LOG(ERROR) << "Model implement is null."; @@ -89,5 +89,4 @@ std::vector Model::GetOutputs() { } return impl_->GetOutputs(); } - } // namespace mindspore diff --git a/mindspore/lite/src/cxx_api/model/model_impl.cc b/mindspore/lite/src/cxx_api/model/model_impl.cc index 47c768e913..776c9e4d3b 100644 --- a/mindspore/lite/src/cxx_api/model/model_impl.cc +++ b/mindspore/lite/src/cxx_api/model/model_impl.cc @@ -127,6 +127,9 @@ Status ModelImpl::Predict(const std::vector &inputs, std::vectorset_data(old_data.at(j)); + } MS_LOG(ERROR) << "Failed to get the data of input tensor."; return kLiteInputTensorError; } @@ -286,5 +289,4 @@ Status ModelImpl::Resize(const std::vector &inputs, const std::vector< auto ret = session_->Resize(inner_input, truncated_shape); return static_cast(ret); } - } // namespace mindspore diff --git a/mindspore/lite/src/cxx_api/model/model_impl.h b/mindspore/lite/src/cxx_api/model/model_impl.h index 0309f1e867..3ad72655b4 100644 --- a/mindspore/lite/src/cxx_api/model/model_impl.h +++ b/mindspore/lite/src/cxx_api/model/model_impl.h @@ -13,8 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef MINDSPORE_LITE_SRC_CXX_API_MODEL_MODEL_IMPL_H #define MINDSPORE_LITE_SRC_CXX_API_MODEL_MODEL_IMPL_H + #include #include #include diff --git a/mindspore/lite/src/cxx_api/serialization.cc b/mindspore/lite/src/cxx_api/serialization.cc index 660cf107ac..32ff753348 100644 --- a/mindspore/lite/src/cxx_api/serialization.cc +++ b/mindspore/lite/src/cxx_api/serialization.cc @@ -27,7 +27,6 @@ #include "src/common/log_adapter.h" namespace mindspore { - Graph Serialization::LoadModel(const void *model_data, size_t data_size, ModelType model_type) { if (model_type != kMindIR) { MS_LOG(ERROR) << "Unsupported IR."; diff --git a/mindspore/lite/src/cxx_api/tensor/tensor_impl.cc b/mindspore/lite/src/cxx_api/tensor/tensor_impl.cc index 1545176029..3a314e2eae 100644 --- a/mindspore/lite/src/cxx_api/tensor/tensor_impl.cc +++ b/mindspore/lite/src/cxx_api/tensor/tensor_impl.cc @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include "src/cxx_api/tensor/tensor_impl.h" #include #include @@ -36,5 +37,4 @@ MSTensor::Impl::Impl(const std::string &name, enum DataType type, const std::vec lite_tensor_ = new (std::nothrow) lite::Tensor(name, static_cast(type), truncated_shape, data); } } - } // namespace mindspore diff --git a/mindspore/lite/src/cxx_api/tensor/tensor_impl.h b/mindspore/lite/src/cxx_api/tensor/tensor_impl.h index ffdeb9293c..c8a36a62e1 100644 --- a/mindspore/lite/src/cxx_api/tensor/tensor_impl.h +++ b/mindspore/lite/src/cxx_api/tensor/tensor_impl.h @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#ifndef MINDSPORE_LITE_SRC_CXX_API_TENSOR_TENSOR_IMPL_H +#define MINDSPORE_LITE_SRC_CXX_API_TENSOR_TENSOR_IMPL_H + #include #include #include @@ -142,5 +146,6 @@ class MSTensor::Impl { bool need_copy_ = true; bool from_session_ = false; }; - } // namespace mindspore + +#endif // MINDSPORE_LITE_SRC_CXX_API_TENSOR_TENSOR_IMPL_H diff --git a/mindspore/lite/src/cxx_api/types.cc b/mindspore/lite/src/cxx_api/types.cc index 876780459b..c81a07ee6d 100644 --- a/mindspore/lite/src/cxx_api/types.cc +++ b/mindspore/lite/src/cxx_api/types.cc @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include "include/api/types.h" #include #include @@ -23,7 +24,6 @@ #include "src/common/log_adapter.h" namespace mindspore { - class Buffer::Impl { public: Impl() : data_() { MS_LOG(ERROR) << "Unsupported feature."; } diff --git a/mindspore/lite/src/cxx_api/utils.h b/mindspore/lite/src/cxx_api/utils.h index 714709ab8c..4da5b85163 100644 --- a/mindspore/lite/src/cxx_api/utils.h +++ b/mindspore/lite/src/cxx_api/utils.h @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#ifndef MINDSPORE_LITE_SRC_CXX_API_UTILS_H +#define MINDSPORE_LITE_SRC_CXX_API_UTILS_H + #include #include #include "src/tensor.h" @@ -45,5 +49,6 @@ static std::vector TruncateShape(const std::vector &shape, enu } return truncated_shape; } - } // namespace mindspore + +#endif // MINDSPORE_LITE_SRC_CXX_API_UTILS_H