From 5f525433239972c0ed3e3e803fc325afa6199221 Mon Sep 17 00:00:00 2001 From: GenMing Zhong Date: Wed, 11 Sep 2024 02:32:21 -0700 Subject: [PATCH 1/7] impl attr release s --- .../core/providers/shared_library/provider_interfaces.h | 1 + .../core/providers/shared_library/provider_wrappedtypes.h | 1 + onnxruntime/core/providers/vitisai/imp/attr_proto.cc | 6 ++++++ onnxruntime/core/providers/vitisai/imp/attr_proto.h | 1 + onnxruntime/core/providers/vitisai/imp/global_api.cc | 1 + .../core/providers/vitisai/include/vaip/vaip_ort_api.h | 3 ++- onnxruntime/core/session/provider_bridge_ort.cc | 4 ++++ 7 files changed, 16 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/shared_library/provider_interfaces.h b/onnxruntime/core/providers/shared_library/provider_interfaces.h index 4f062efb09e7f..32f24632000f8 100644 --- a/onnxruntime/core/providers/shared_library/provider_interfaces.h +++ b/onnxruntime/core/providers/shared_library/provider_interfaces.h @@ -389,6 +389,7 @@ struct ProviderHost { virtual void AttributeProto__set_name(ONNX_NAMESPACE::AttributeProto* p, const ::std::string& value) = 0; virtual void AttributeProto__set_type(ONNX_NAMESPACE::AttributeProto* p, ONNX_NAMESPACE::AttributeProto_AttributeType value) = 0; virtual ONNX_NAMESPACE::TensorProto* AttributeProto__add_tensors(ONNX_NAMESPACE::AttributeProto* p) = 0; + virtual void AttributeProto__release_s(ONNX_NAMESPACE::AttributeProto* p) = 0; // GraphProto virtual std::unique_ptr GraphProto__construct() = 0; diff --git a/onnxruntime/core/providers/shared_library/provider_wrappedtypes.h b/onnxruntime/core/providers/shared_library/provider_wrappedtypes.h index 63ef36b0a7942..b208a12adc9a5 100644 --- a/onnxruntime/core/providers/shared_library/provider_wrappedtypes.h +++ b/onnxruntime/core/providers/shared_library/provider_wrappedtypes.h @@ -122,6 +122,7 @@ struct AttributeProto final { void set_name(const ::std::string& value) { return g_host->AttributeProto__set_name(this, value); } void set_type(AttributeProto_AttributeType value) { return g_host->AttributeProto__set_type(this, value); } TensorProto* add_tensors() { return g_host->AttributeProto__add_tensors(this); } + void release_s() { return g_host->AttributeProto__release_s(this); } typedef AttributeProto_AttributeType AttributeType; static constexpr AttributeType UNDEFINED = AttributeProto_AttributeType_UNDEFINED; diff --git a/onnxruntime/core/providers/vitisai/imp/attr_proto.cc b/onnxruntime/core/providers/vitisai/imp/attr_proto.cc index a9275b24ce91f..4ecae739ddb03 100644 --- a/onnxruntime/core/providers/vitisai/imp/attr_proto.cc +++ b/onnxruntime/core/providers/vitisai/imp/attr_proto.cc @@ -104,4 +104,10 @@ std::vector attr_proto_get_strings(const ONNX_NAMESPACE::AttributeP } return ret; } + +void attr_proto_release_strings(ONNX_NAMESPACE::AttributeProto* attr) { + vai_assert(attr->type() == ONNX_NAMESPACE::AttributeProto_AttributeType_STRINGS, attr->name()); + attr->release_s(); + return; +} } // namespace vaip diff --git a/onnxruntime/core/providers/vitisai/imp/attr_proto.h b/onnxruntime/core/providers/vitisai/imp/attr_proto.h index bb2883512037b..87108aac2853e 100644 --- a/onnxruntime/core/providers/vitisai/imp/attr_proto.h +++ b/onnxruntime/core/providers/vitisai/imp/attr_proto.h @@ -23,5 +23,6 @@ const ONNX_NAMESPACE::TensorProto& attr_proto_get_tensor(const ONNX_NAMESPACE::A gsl::span attr_proto_get_ints(const ONNX_NAMESPACE::AttributeProto& attr); gsl::span attr_proto_get_floats(const ONNX_NAMESPACE::AttributeProto& attr); std::vector attr_proto_get_strings(const ONNX_NAMESPACE::AttributeProto& attr); +void attr_proto_release_strings(ONNX_NAMESPACE::AttributeProto* attr); } // namespace vaip diff --git a/onnxruntime/core/providers/vitisai/imp/global_api.cc b/onnxruntime/core/providers/vitisai/imp/global_api.cc index 6f8e153cd1232..bdef2cc3ffff2 100644 --- a/onnxruntime/core/providers/vitisai/imp/global_api.cc +++ b/onnxruntime/core/providers/vitisai/imp/global_api.cc @@ -328,6 +328,7 @@ vaip_core::OrtApiForVaip* create_org_api_hook() { the_global_api.attr_proto_get_floats = vaip::attr_proto_get_floats; the_global_api.attr_proto_get_strings = vaip::attr_proto_get_strings; the_global_api.attr_proto_get_type = [](const ONNX_NAMESPACE::AttributeProto& attr) -> int { return attr.type(); }; + the_global_api.attr_proto_release_strings = vaip::attr_proto_release_strings; /// node attributes the_global_api.node_attributes_new = []() { return NodeAttributes::Create().release(); }; diff --git a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h index a75c5553c7b3b..27173a56db2dc 100644 --- a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h +++ b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h @@ -171,7 +171,8 @@ struct OrtApiForVaip { const AttributeProto& attr); // [68] std::vector (*attr_proto_get_strings)( const AttributeProto& attr); // [69] - + void (*attr_proto_release_strings)( + AttributeProto* attr); // [70] // tensor_proto void (*tensor_proto_delete)(TensorProto* tp); // [70] DllSafe> (*tensor_proto_get_shape_unsafe)( diff --git a/onnxruntime/core/session/provider_bridge_ort.cc b/onnxruntime/core/session/provider_bridge_ort.cc index 8e807c375143e..21ac8824ead6f 100644 --- a/onnxruntime/core/session/provider_bridge_ort.cc +++ b/onnxruntime/core/session/provider_bridge_ort.cc @@ -495,6 +495,10 @@ struct ProviderHostImpl : ProviderHost { void AttributeProto__set_name(ONNX_NAMESPACE::AttributeProto* p, const ::std::string& value) override { return p->set_name(value); } void AttributeProto__set_type(ONNX_NAMESPACE::AttributeProto* p, ONNX_NAMESPACE::AttributeProto_AttributeType value) override { return p->set_type(value); } ONNX_NAMESPACE::TensorProto* AttributeProto__add_tensors(ONNX_NAMESPACE::AttributeProto* p) override { return p->add_tensors(); } + void AttributeProto__release_s(ONNX_NAMESPACE::AttributeProto* p) override { + auto s = p->release_s(); + delete s; + } // GraphProto (wrapped) std::unique_ptr GraphProto__construct() override { return std::make_unique(); } From 25b71a3ba3f80356a2e1b8d000d427511a2786ab Mon Sep 17 00:00:00 2001 From: GenMing Zhong Date: Wed, 11 Sep 2024 07:55:25 -0700 Subject: [PATCH 2/7] fix name --- onnxruntime/core/providers/vitisai/imp/attr_proto.cc | 4 ++-- onnxruntime/core/providers/vitisai/imp/global_api.cc | 2 +- .../core/providers/vitisai/include/vaip/vaip_ort_api.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/onnxruntime/core/providers/vitisai/imp/attr_proto.cc b/onnxruntime/core/providers/vitisai/imp/attr_proto.cc index 4ecae739ddb03..541bd6f2abd84 100644 --- a/onnxruntime/core/providers/vitisai/imp/attr_proto.cc +++ b/onnxruntime/core/providers/vitisai/imp/attr_proto.cc @@ -105,8 +105,8 @@ std::vector attr_proto_get_strings(const ONNX_NAMESPACE::AttributeP return ret; } -void attr_proto_release_strings(ONNX_NAMESPACE::AttributeProto* attr) { - vai_assert(attr->type() == ONNX_NAMESPACE::AttributeProto_AttributeType_STRINGS, attr->name()); +void attr_proto_release_string(ONNX_NAMESPACE::AttributeProto* attr) { + vai_assert(attr->type() == ONNX_NAMESPACE::AttributeProto_AttributeType_STRING, attr->name()); attr->release_s(); return; } diff --git a/onnxruntime/core/providers/vitisai/imp/global_api.cc b/onnxruntime/core/providers/vitisai/imp/global_api.cc index bdef2cc3ffff2..4d8dddfeaf5a2 100644 --- a/onnxruntime/core/providers/vitisai/imp/global_api.cc +++ b/onnxruntime/core/providers/vitisai/imp/global_api.cc @@ -328,7 +328,7 @@ vaip_core::OrtApiForVaip* create_org_api_hook() { the_global_api.attr_proto_get_floats = vaip::attr_proto_get_floats; the_global_api.attr_proto_get_strings = vaip::attr_proto_get_strings; the_global_api.attr_proto_get_type = [](const ONNX_NAMESPACE::AttributeProto& attr) -> int { return attr.type(); }; - the_global_api.attr_proto_release_strings = vaip::attr_proto_release_strings; + the_global_api.attr_proto_release_string = vaip::attr_proto_release_string; /// node attributes the_global_api.node_attributes_new = []() { return NodeAttributes::Create().release(); }; diff --git a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h index 27173a56db2dc..ec4c41cc4bb48 100644 --- a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h +++ b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h @@ -171,7 +171,7 @@ struct OrtApiForVaip { const AttributeProto& attr); // [68] std::vector (*attr_proto_get_strings)( const AttributeProto& attr); // [69] - void (*attr_proto_release_strings)( + void (*attr_proto_release_string)( AttributeProto* attr); // [70] // tensor_proto void (*tensor_proto_delete)(TensorProto* tp); // [70] From bce99aa930ea4f9c8edd27ee0611a1690419a5ae Mon Sep 17 00:00:00 2001 From: genmingz Date: Wed, 11 Sep 2024 08:19:05 -0700 Subject: [PATCH 3/7] fix name2 --- onnxruntime/core/providers/vitisai/imp/attr_proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/vitisai/imp/attr_proto.h b/onnxruntime/core/providers/vitisai/imp/attr_proto.h index 87108aac2853e..4c1c22ca77a16 100644 --- a/onnxruntime/core/providers/vitisai/imp/attr_proto.h +++ b/onnxruntime/core/providers/vitisai/imp/attr_proto.h @@ -23,6 +23,6 @@ const ONNX_NAMESPACE::TensorProto& attr_proto_get_tensor(const ONNX_NAMESPACE::A gsl::span attr_proto_get_ints(const ONNX_NAMESPACE::AttributeProto& attr); gsl::span attr_proto_get_floats(const ONNX_NAMESPACE::AttributeProto& attr); std::vector attr_proto_get_strings(const ONNX_NAMESPACE::AttributeProto& attr); -void attr_proto_release_strings(ONNX_NAMESPACE::AttributeProto* attr); +void attr_proto_release_string(ONNX_NAMESPACE::AttributeProto* attr); } // namespace vaip From 8fdc728e2deefc55fd0e9fafe0ca6e69994a9ad2 Mon Sep 17 00:00:00 2001 From: genmingz Date: Fri, 13 Sep 2024 00:05:12 -0700 Subject: [PATCH 4/7] update api --- .../core/providers/shared_library/provider_interfaces.h | 2 +- .../core/providers/shared_library/provider_wrappedtypes.h | 2 +- onnxruntime/core/providers/vitisai/imp/attr_proto.cc | 5 ++--- onnxruntime/core/providers/vitisai/imp/attr_proto.h | 2 +- onnxruntime/core/providers/vitisai/imp/global_api.cc | 2 +- .../core/providers/vitisai/include/vaip/vaip_ort_api.h | 2 +- onnxruntime/core/session/provider_bridge_ort.cc | 5 +---- 7 files changed, 8 insertions(+), 12 deletions(-) diff --git a/onnxruntime/core/providers/shared_library/provider_interfaces.h b/onnxruntime/core/providers/shared_library/provider_interfaces.h index 32f24632000f8..57e2fc9c1b09e 100644 --- a/onnxruntime/core/providers/shared_library/provider_interfaces.h +++ b/onnxruntime/core/providers/shared_library/provider_interfaces.h @@ -389,7 +389,7 @@ struct ProviderHost { virtual void AttributeProto__set_name(ONNX_NAMESPACE::AttributeProto* p, const ::std::string& value) = 0; virtual void AttributeProto__set_type(ONNX_NAMESPACE::AttributeProto* p, ONNX_NAMESPACE::AttributeProto_AttributeType value) = 0; virtual ONNX_NAMESPACE::TensorProto* AttributeProto__add_tensors(ONNX_NAMESPACE::AttributeProto* p) = 0; - virtual void AttributeProto__release_s(ONNX_NAMESPACE::AttributeProto* p) = 0; + virtual std::string* AttributeProto__release_s(ONNX_NAMESPACE::AttributeProto* p) = 0; // GraphProto virtual std::unique_ptr GraphProto__construct() = 0; diff --git a/onnxruntime/core/providers/shared_library/provider_wrappedtypes.h b/onnxruntime/core/providers/shared_library/provider_wrappedtypes.h index b208a12adc9a5..60671b280e58d 100644 --- a/onnxruntime/core/providers/shared_library/provider_wrappedtypes.h +++ b/onnxruntime/core/providers/shared_library/provider_wrappedtypes.h @@ -122,7 +122,7 @@ struct AttributeProto final { void set_name(const ::std::string& value) { return g_host->AttributeProto__set_name(this, value); } void set_type(AttributeProto_AttributeType value) { return g_host->AttributeProto__set_type(this, value); } TensorProto* add_tensors() { return g_host->AttributeProto__add_tensors(this); } - void release_s() { return g_host->AttributeProto__release_s(this); } + std::string* release_s() { return g_host->AttributeProto__release_s(this); } typedef AttributeProto_AttributeType AttributeType; static constexpr AttributeType UNDEFINED = AttributeProto_AttributeType_UNDEFINED; diff --git a/onnxruntime/core/providers/vitisai/imp/attr_proto.cc b/onnxruntime/core/providers/vitisai/imp/attr_proto.cc index 541bd6f2abd84..06970ef11189c 100644 --- a/onnxruntime/core/providers/vitisai/imp/attr_proto.cc +++ b/onnxruntime/core/providers/vitisai/imp/attr_proto.cc @@ -105,9 +105,8 @@ std::vector attr_proto_get_strings(const ONNX_NAMESPACE::AttributeP return ret; } -void attr_proto_release_string(ONNX_NAMESPACE::AttributeProto* attr) { +std::string* attr_proto_release_string(ONNX_NAMESPACE::AttributeProto* attr) { vai_assert(attr->type() == ONNX_NAMESPACE::AttributeProto_AttributeType_STRING, attr->name()); - attr->release_s(); - return; + return attr->release_s(); } } // namespace vaip diff --git a/onnxruntime/core/providers/vitisai/imp/attr_proto.h b/onnxruntime/core/providers/vitisai/imp/attr_proto.h index 4c1c22ca77a16..08d980ec94c14 100644 --- a/onnxruntime/core/providers/vitisai/imp/attr_proto.h +++ b/onnxruntime/core/providers/vitisai/imp/attr_proto.h @@ -23,6 +23,6 @@ const ONNX_NAMESPACE::TensorProto& attr_proto_get_tensor(const ONNX_NAMESPACE::A gsl::span attr_proto_get_ints(const ONNX_NAMESPACE::AttributeProto& attr); gsl::span attr_proto_get_floats(const ONNX_NAMESPACE::AttributeProto& attr); std::vector attr_proto_get_strings(const ONNX_NAMESPACE::AttributeProto& attr); -void attr_proto_release_string(ONNX_NAMESPACE::AttributeProto* attr); +std::string* attr_proto_release_string(ONNX_NAMESPACE::AttributeProto* attr); } // namespace vaip diff --git a/onnxruntime/core/providers/vitisai/imp/global_api.cc b/onnxruntime/core/providers/vitisai/imp/global_api.cc index 4d8dddfeaf5a2..de647fd7828a1 100644 --- a/onnxruntime/core/providers/vitisai/imp/global_api.cc +++ b/onnxruntime/core/providers/vitisai/imp/global_api.cc @@ -328,7 +328,7 @@ vaip_core::OrtApiForVaip* create_org_api_hook() { the_global_api.attr_proto_get_floats = vaip::attr_proto_get_floats; the_global_api.attr_proto_get_strings = vaip::attr_proto_get_strings; the_global_api.attr_proto_get_type = [](const ONNX_NAMESPACE::AttributeProto& attr) -> int { return attr.type(); }; - the_global_api.attr_proto_release_string = vaip::attr_proto_release_string; + the_global_api.attr_proto_release_string = [](ONNX_NAMESPACE::AttributeProto* attr) -> vaip_core::DllSafe { return vaip_core::DllSafe(vaip::attr_proto_release_string(attr)); }; /// node attributes the_global_api.node_attributes_new = []() { return NodeAttributes::Create().release(); }; diff --git a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h index ec4c41cc4bb48..809ae38ef2f59 100644 --- a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h +++ b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h @@ -171,7 +171,7 @@ struct OrtApiForVaip { const AttributeProto& attr); // [68] std::vector (*attr_proto_get_strings)( const AttributeProto& attr); // [69] - void (*attr_proto_release_string)( + DllSafe (*attr_proto_release_string)( AttributeProto* attr); // [70] // tensor_proto void (*tensor_proto_delete)(TensorProto* tp); // [70] diff --git a/onnxruntime/core/session/provider_bridge_ort.cc b/onnxruntime/core/session/provider_bridge_ort.cc index 21ac8824ead6f..c53afbcea28ff 100644 --- a/onnxruntime/core/session/provider_bridge_ort.cc +++ b/onnxruntime/core/session/provider_bridge_ort.cc @@ -495,10 +495,7 @@ struct ProviderHostImpl : ProviderHost { void AttributeProto__set_name(ONNX_NAMESPACE::AttributeProto* p, const ::std::string& value) override { return p->set_name(value); } void AttributeProto__set_type(ONNX_NAMESPACE::AttributeProto* p, ONNX_NAMESPACE::AttributeProto_AttributeType value) override { return p->set_type(value); } ONNX_NAMESPACE::TensorProto* AttributeProto__add_tensors(ONNX_NAMESPACE::AttributeProto* p) override { return p->add_tensors(); } - void AttributeProto__release_s(ONNX_NAMESPACE::AttributeProto* p) override { - auto s = p->release_s(); - delete s; - } + std::string* AttributeProto__release_s(ONNX_NAMESPACE::AttributeProto* p) override { return p->release_s(); } // GraphProto (wrapped) std::unique_ptr GraphProto__construct() override { return std::make_unique(); } From d8dbf772a860dbd0509dbfbe99232455c7cb7be5 Mon Sep 17 00:00:00 2001 From: genmingz Date: Fri, 13 Sep 2024 19:30:06 -0700 Subject: [PATCH 5/7] update string* to string --- onnxruntime/core/providers/vitisai/imp/global_api.cc | 8 +++++++- .../core/providers/vitisai/include/vaip/vaip_ort_api.h | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/onnxruntime/core/providers/vitisai/imp/global_api.cc b/onnxruntime/core/providers/vitisai/imp/global_api.cc index de647fd7828a1..048128bf8da64 100644 --- a/onnxruntime/core/providers/vitisai/imp/global_api.cc +++ b/onnxruntime/core/providers/vitisai/imp/global_api.cc @@ -328,7 +328,6 @@ vaip_core::OrtApiForVaip* create_org_api_hook() { the_global_api.attr_proto_get_floats = vaip::attr_proto_get_floats; the_global_api.attr_proto_get_strings = vaip::attr_proto_get_strings; the_global_api.attr_proto_get_type = [](const ONNX_NAMESPACE::AttributeProto& attr) -> int { return attr.type(); }; - the_global_api.attr_proto_release_string = [](ONNX_NAMESPACE::AttributeProto* attr) -> vaip_core::DllSafe { return vaip_core::DllSafe(vaip::attr_proto_release_string(attr)); }; /// node attributes the_global_api.node_attributes_new = []() { return NodeAttributes::Create().release(); }; @@ -407,6 +406,13 @@ vaip_core::OrtApiForVaip* create_org_api_hook() { graph.SetInputs(inputs); }; the_global_api.node_arg_external_location = vaip::node_arg_external_location; + the_global_api.attr_proto_release_string = [](ONNX_NAMESPACE::AttributeProto* attr) -> vaip_core::DllSafe { + auto pstr = vaip::attr_proto_release_string(attr); + std::string local_str = std::move(*pstr); + pstr = nullptr; + return vaip_core::DllSafe(std::move(local_str)); + }; + if (!s_library_vitisaiep.vaip_get_version) { return reinterpret_cast(&(the_global_api.host_)); } else { diff --git a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h index 809ae38ef2f59..28f4722204aac 100644 --- a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h +++ b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h @@ -171,8 +171,6 @@ struct OrtApiForVaip { const AttributeProto& attr); // [68] std::vector (*attr_proto_get_strings)( const AttributeProto& attr); // [69] - DllSafe (*attr_proto_release_string)( - AttributeProto* attr); // [70] // tensor_proto void (*tensor_proto_delete)(TensorProto* tp); // [70] DllSafe> (*tensor_proto_get_shape_unsafe)( @@ -196,7 +194,6 @@ struct OrtApiForVaip { gsl::span (*tensor_proto_as_raw)( const Graph& graph, const TensorProto& tensor); // [79] - DllSafe (*get_lib_id)(); // [80] DllSafe (*get_lib_name)(); // [81] /** new API after 2.0 */ @@ -231,8 +228,10 @@ struct OrtApiForVaip { void (*graph_set_inputs)(Graph& graph, gsl::span inputs); // [92] int (*node_arg_external_location)(const Graph& graph, const NodeArg& node_arg, std::string& file, size_t& offset, size_t& size, size_t& checksum); // [93] + DllSafe (*attr_proto_release_string)(AttributeProto* attr); // [94] }; + #ifndef USE_VITISAI VAIP_DLL_SPEC const OrtApiForVaip* api(); // avoid macro redefinitions in vitisai ort ep. From e8b889ae82e28ef9fcf886a2e4adf4734139053b Mon Sep 17 00:00:00 2001 From: "genmingz@AMD" Date: Thu, 5 Dec 2024 12:16:33 +0800 Subject: [PATCH 6/7] Update vaip_ort_version --- onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h index bce363828430c..b917d01864802 100644 --- a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h +++ b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h @@ -13,7 +13,7 @@ struct OrtApi; namespace vaip_core { -#define VAIP_ORT_API_MAJOR (11u) +#define VAIP_ORT_API_MAJOR (12u) #define VAIP_ORT_API_MINOR (0u) #define VAIP_ORT_API_PATCH (0u) struct OrtApiForVaip { From b18a883b026bc244e2e27caeea8de0e8816a2439 Mon Sep 17 00:00:00 2001 From: genmingz Date: Sun, 8 Dec 2024 23:20:27 -0800 Subject: [PATCH 7/7] lint --- onnxruntime/core/providers/vitisai/imp/global_api.cc | 2 +- onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/vitisai/imp/global_api.cc b/onnxruntime/core/providers/vitisai/imp/global_api.cc index e6d8160a58cb8..51dc79c569589 100644 --- a/onnxruntime/core/providers/vitisai/imp/global_api.cc +++ b/onnxruntime/core/providers/vitisai/imp/global_api.cc @@ -454,7 +454,7 @@ vaip_core::OrtApiForVaip* create_org_api_hook() { std::string local_str = std::move(*pstr); pstr = nullptr; return vaip_core::DllSafe(std::move(local_str)); - }; + }; if (!s_library_vitisaiep.vaip_get_version) { return reinterpret_cast(&(the_global_api.host_)); diff --git a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h index b917d01864802..9425c08dceebc 100644 --- a/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h +++ b/onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h @@ -234,7 +234,7 @@ struct OrtApiForVaip { ModelProto* (*model_to_proto)(Model& model); // [95] DllSafe (*model_proto_serialize_as_string)(ModelProto& model_proto); // [96] void (*model_proto_delete)(ModelProto* p); // [97] - DllSafe (*attr_proto_release_string)(AttributeProto* attr); // [98] + DllSafe (*attr_proto_release_string)(AttributeProto* attr); // [98] }; #ifndef USE_VITISAI