@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved. | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved. | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved. | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved. | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved. | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved. | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved. | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved. | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved. | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -17,20 +17,6 @@ | |||||
#ifndef GE_PARSER_ONNX_SUBGRAPH_ADAPTER_SUBGRAPH_ADAPTER_FACTORY_H_ | #ifndef GE_PARSER_ONNX_SUBGRAPH_ADAPTER_SUBGRAPH_ADAPTER_FACTORY_H_ | ||||
#define GE_PARSER_ONNX_SUBGRAPH_ADAPTER_SUBGRAPH_ADAPTER_FACTORY_H_ | #define GE_PARSER_ONNX_SUBGRAPH_ADAPTER_SUBGRAPH_ADAPTER_FACTORY_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 <map> | #include <map> | ||||
#include <memory> | #include <memory> | ||||
#include <functional> | #include <functional> | ||||
@@ -106,10 +92,9 @@ public: | |||||
*/ | */ | ||||
#define REGISTER_SUBGRAPH_ADAPTER_CREATOR(op_type, clazz) \ | #define REGISTER_SUBGRAPH_ADAPTER_CREATOR(op_type, clazz) \ | ||||
std::shared_ptr<SubgraphAdapter> Creator_##op_type##_Subgraph_Adapter() { \ | std::shared_ptr<SubgraphAdapter> Creator_##op_type##_Subgraph_Adapter() { \ | ||||
std::shared_ptr<clazz> ptr(new (std::nothrow) clazz()); \ | |||||
if (ptr == nullptr) { \ | |||||
GELOGW("MakeShared failed, result is nullptr."); \ | |||||
} \ | |||||
std::shared_ptr<clazz> ptr = nullptr; \ | |||||
GE_MAKE_SHARED(ptr = std::make_shared<clazz>(), \ | |||||
ptr = nullptr); \ | |||||
return std::shared_ptr<SubgraphAdapter>(ptr); \ | return std::shared_ptr<SubgraphAdapter>(ptr); \ | ||||
} \ | } \ | ||||
ge::SubgraphAdapterRegisterar g_##op_type##_Subgraph_Adapter_Creator(op_type, \ | ge::SubgraphAdapterRegisterar g_##op_type##_Subgraph_Adapter_Creator(op_type, \ | ||||
@@ -223,7 +223,7 @@ domi::Status GraphToFunctionDef::RecordResult(ge::ComputeGraphPtr graph, | |||||
GE_CHECK_NOTNULL(anchor->GetOwnerNode()->GetOpDesc()); | GE_CHECK_NOTNULL(anchor->GetOwnerNode()->GetOpDesc()); | ||||
int32_t type = anchor->GetOwnerNode()->GetOpDesc()->GetOutputDesc(anchor->GetIdx()).GetDataType(); | int32_t type = anchor->GetOwnerNode()->GetOpDesc()->GetOutputDesc(anchor->GetIdx()).GetDataType(); | ||||
std::map<int32_t, int32_t>::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type); | std::map<int32_t, int32_t>::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type); | ||||
GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), | |||||
GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.cend(), | |||||
REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported", | REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported", | ||||
type, anchor->GetIdx(), anchor->GetOwnerNode()->GetName().c_str(), | type, anchor->GetIdx(), anchor->GetOwnerNode()->GetName().c_str(), | ||||
anchor->GetOwnerNode()->GetName().c_str()); | anchor->GetOwnerNode()->GetName().c_str()); | ||||
@@ -300,7 +300,7 @@ domi::Status GraphToFunctionDef::RecordArg(ge::ComputeGraphPtr graph, const vect | |||||
int32_t type = tensor_desc_ptr->GetDataType(); | int32_t type = tensor_desc_ptr->GetDataType(); | ||||
std::map<int32_t, int32_t>::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type); | std::map<int32_t, int32_t>::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type); | ||||
GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), | |||||
GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.cend(), | |||||
REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported", | REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported", | ||||
type, anchor->GetIdx(), anchor->GetOwnerNode()->GetName().c_str(), | type, anchor->GetIdx(), anchor->GetOwnerNode()->GetName().c_str(), | ||||
anchor->GetOwnerNode()->GetName().c_str()); | anchor->GetOwnerNode()->GetName().c_str()); | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020-2021 Huawei Technologies Co., Ltd | |||||
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -394,7 +394,7 @@ Status ParserGraphOptimizer::RebuildOutputAnchors(vector<ge::OutDataAnchorPtr> & | |||||
const std::map<int32_t, int32_t>::const_iterator iter = | const std::map<int32_t, int32_t>::const_iterator iter = | ||||
GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast<int32_t>(data_type)); | GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast<int32_t>(data_type)); | ||||
GE_IF_BOOL_EXEC( | GE_IF_BOOL_EXEC( | ||||
iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), | |||||
iter == GE_TENSORFLOW_DATA_TYPE_MAP.cend(), | |||||
REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported", | REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported", | ||||
data_type, out_anchor->GetIdx(), src_node->GetName().c_str(), src_node->GetName().c_str()); | data_type, out_anchor->GetIdx(), src_node->GetName().c_str(), src_node->GetName().c_str()); | ||||
GELOGE(PARAM_INVALID, "data_type %s not supported", ge::TypeUtils::DataTypeToSerialString(data_type).c_str()); | GELOGE(PARAM_INVALID, "data_type %s not supported", ge::TypeUtils::DataTypeToSerialString(data_type).c_str()); | ||||
@@ -431,7 +431,7 @@ Status ParserGraphOptimizer::RebuildInputAnchors(vector<ge::InDataAnchorPtr> &in | |||||
const std::map<int32_t, int32_t>::const_iterator iter = | const std::map<int32_t, int32_t>::const_iterator iter = | ||||
GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast<int32_t>(data_type)); | GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast<int32_t>(data_type)); | ||||
GE_IF_BOOL_EXEC( | GE_IF_BOOL_EXEC( | ||||
iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), | |||||
iter == GE_TENSORFLOW_DATA_TYPE_MAP.cend(), | |||||
REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported", | REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported", | ||||
data_type, in_anchor->GetIdx(), dst_node->GetName().c_str(), dst_node->GetName().c_str()); | data_type, in_anchor->GetIdx(), dst_node->GetName().c_str(), dst_node->GetName().c_str()); | ||||
GELOGE(PARAM_INVALID, "data_type %s not supported", ge::TypeUtils::DataTypeToSerialString(data_type).c_str()); | GELOGE(PARAM_INVALID, "data_type %s not supported", ge::TypeUtils::DataTypeToSerialString(data_type).c_str()); | ||||