From fa668f39ab3a70c19254b4000a00fcaea665b311 Mon Sep 17 00:00:00 2001 From: xujiuxu <9095800+xujiuxu@user.noreply.gitee.com> Date: Thu, 1 Sep 2022 06:15:28 +0000 Subject: [PATCH] =?UTF-8?q?!646=20parser=20=E4=BB=93=E5=AF=B9=E5=A4=96?= =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E5=9B=9E=E9=80=80=20Merge=20pull=20?= =?UTF-8?q?request=20!646=20from=20xujiuxu/master?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 1 - inc/external/parser/caffe_parser.h | 15 ++++++++++- inc/external/parser/onnx_parser.h | 15 ++++++++++- inc/external/parser/parser_common.h | 34 ------------------------- inc/external/parser/tensorflow_parser.h | 16 ++++++++++-- 5 files changed, 42 insertions(+), 39 deletions(-) delete mode 100644 inc/external/parser/parser_common.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 83d24c9..6f46a1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,7 +253,6 @@ install(TARGETS _caffe_parser parser_common fmk_onnx_parser fmk_parser parser_he install(FILES ${PARSER_DIR}/inc/external/parser/onnx_parser.h ${PARSER_DIR}/inc/external/parser/caffe_parser.h ${PARSER_DIR}/inc/external/parser/tensorflow_parser.h - ${PARSER_DIR}/inc/external/parser/parser_common.h DESTINATION ${INSTALL_INCLUDE_DIR}/parser/external/parser COMPONENT opensdk EXCLUDE_FROM_ALL ) diff --git a/inc/external/parser/caffe_parser.h b/inc/external/parser/caffe_parser.h index 90a7987..5b1799a 100644 --- a/inc/external/parser/caffe_parser.h +++ b/inc/external/parser/caffe_parser.h @@ -17,6 +17,20 @@ #ifndef INC_EXTERNAL_ACL_GRAPH_CAFFE_H_ #define INC_EXTERNAL_ACL_GRAPH_CAFFE_H_ +#if defined(_MSC_VER) +#ifdef FUNC_VISIBILITY +#define PARSER_FUNC_VISIBILITY _declspec(dllexport) +#else +#define PARSER_FUNC_VISIBILITY +#endif +#else +#ifdef FUNC_VISIBILITY +#define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) +#else +#define PARSER_FUNC_VISIBILITY +#endif +#endif + #include #include #include @@ -24,7 +38,6 @@ #include "graph/ascend_string.h" #include "graph/ge_error_codes.h" #include "graph/graph.h" -#include "parser_common.h" namespace ge { PARSER_FUNC_VISIBILITY graphStatus aclgrphParseCaffe(const char *model_file, const char *weights_file, diff --git a/inc/external/parser/onnx_parser.h b/inc/external/parser/onnx_parser.h index 12be388..cbfa6a2 100644 --- a/inc/external/parser/onnx_parser.h +++ b/inc/external/parser/onnx_parser.h @@ -17,11 +17,24 @@ #ifndef INC_EXTERNAL_PARSER_ONNX_PARSER_H_ #define INC_EXTERNAL_PARSER_ONNX_PARSER_H_ +#if defined(_MSC_VER) +#ifdef FUNC_VISIBILITY +#define PARSER_FUNC_VISIBILITY _declspec(dllexport) +#else +#define PARSER_FUNC_VISIBILITY +#endif +#else +#ifdef FUNC_VISIBILITY +#define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) +#else +#define PARSER_FUNC_VISIBILITY +#endif +#endif + #include #include "graph/ascend_string.h" #include "graph/ge_error_codes.h" #include "graph/graph.h" -#include "parser_common.h" namespace ge { PARSER_FUNC_VISIBILITY graphStatus aclgrphParseONNX(const char *model_file, diff --git a/inc/external/parser/parser_common.h b/inc/external/parser/parser_common.h deleted file mode 100644 index 25fa3bf..0000000 --- a/inc/external/parser/parser_common.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. 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. - */ - -#ifndef INC_EXTERNAL_ACL_PARSER_COMMON_H_ -#define INC_EXTERNAL_ACL_PARSER_COMMON_H_ - -#if defined(_MSC_VER) -#ifdef FUNC_VISIBILITY -#define PARSER_FUNC_VISIBILITY _declspec(dllexport) -#else -#define PARSER_FUNC_VISIBILITY -#endif -#else -#ifdef FUNC_VISIBILITY -#define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) -#else -#define PARSER_FUNC_VISIBILITY -#endif -#endif - -#endif // INC_EXTERNAL_ACL_PARSER_COMMON_H_ \ No newline at end of file diff --git a/inc/external/parser/tensorflow_parser.h b/inc/external/parser/tensorflow_parser.h index 705b022..d863e0a 100644 --- a/inc/external/parser/tensorflow_parser.h +++ b/inc/external/parser/tensorflow_parser.h @@ -17,15 +17,27 @@ #ifndef INC_EXTERNAL_ACL_PARSER_TENSORFLOW_H_ #define INC_EXTERNAL_ACL_PARSER_TENSORFLOW_H_ +#if defined(_MSC_VER) +#ifdef FUNC_VISIBILITY +#define PARSER_FUNC_VISIBILITY _declspec(dllexport) +#else +#define PARSER_FUNC_VISIBILITY +#endif +#else +#ifdef FUNC_VISIBILITY +#define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) +#else +#define PARSER_FUNC_VISIBILITY +#endif +#endif + #include #include #include #include - #include "graph/ascend_string.h" #include "graph/ge_error_codes.h" #include "graph/graph.h" -#include "parser_common.h" namespace ge { PARSER_FUNC_VISIBILITY graphStatus aclgrphParseTensorFlow(const char *model_file, ge::Graph &graph);