Skip to content

Commit

Permalink
add model_proto_delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhenze Wang committed Sep 14, 2024
1 parent 0053edc commit 542f026
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions onnxruntime/core/providers/vitisai/imp/global_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ vaip_core::OrtApiForVaip* create_org_api_hook() {
the_global_api.model_proto_serialize_as_string = [](ONNX_NAMESPACE::ModelProto& model_proto) {
return vaip_core::DllSafe(model_proto.SerializeAsString());
};
the_global_api.model_proto_delete = [](ONNX_NAMESPACE::ModelProto* p) { delete p; };
if (!s_library_vitisaiep.vaip_get_version) {
return reinterpret_cast<vaip_core::OrtApiForVaip*>(&(the_global_api.host_));
} else {
Expand Down
11 changes: 6 additions & 5 deletions onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,12 @@ struct OrtApiForVaip {
const std::vector<int16_t>& data); // [89]
const std::filesystem::path& (*get_model_path)(const Graph& graph); // [90]
Model* (*create_empty_model)(const std::filesystem::path& path, const std::vector<std::pair<std::string, int64_t>>& opset); //[91]
void (*graph_set_inputs)(Graph& graph,
gsl::span<const NodeArg* const> 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]
ModelProto* (*model_to_proto)(Model& model); //[94]
DllSafe<std::string> (*model_proto_serialize_as_string)(ModelProto& model_proto); //[95]
void (*graph_set_inputs)(Graph& graph, gsl::span<const NodeArg* const> 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]
ModelProto* (*model_to_proto)(Model& model); //[94]
DllSafe<std::string> (*model_proto_serialize_as_string)(ModelProto& model_proto); //[95]
void (*model_proto_delete)(ModelProto* p); // [96]
};

#ifndef USE_VITISAI
Expand Down

0 comments on commit 542f026

Please sign in to comment.