Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -498,6 +498,7 @@ vaip_core::OrtApiForVaip* create_org_api_hook() {
the_global_api.tensor_proto_get_shape_unsafe = vaip::tensor_proto_get_shape;
the_global_api.tensor_proto_data_type = [](const ONNX_NAMESPACE::TensorProto& t) -> int { return t.data_type(); };
the_global_api.tensor_proto_delete = [](ONNX_NAMESPACE::TensorProto* tp) { delete tp; };
the_global_api.tensor_proto_new_bool = vaip::tensor_proto_new_bool;
the_global_api.tensor_proto_new_i4 = vaip::tensor_proto_new_i4;
the_global_api.tensor_proto_new_i8 = vaip::tensor_proto_new_i8;
the_global_api.tensor_proto_new_i16 = vaip::tensor_proto_new_i16;
Expand Down
6 changes: 6 additions & 0 deletions onnxruntime/core/providers/vitisai/imp/tensor_proto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ static ONNX_NAMESPACE::TensorProto* tensor_proto_new(const std::string& name, co
return tensor_proto.release();
}

ONNX_NAMESPACE::TensorProto* tensor_proto_new_bool(const std::string& name, const std::vector<int64_t>& shape,
const std::vector<uint8_t>& data) {
return tensor_proto_new(name, shape, ONNX_NAMESPACE::TensorProto_DataType_BOOL,
reinterpret_cast<const char*>(&data[0]), data.size() * sizeof(data[0]));
}

ONNX_NAMESPACE::TensorProto* tensor_proto_new_i4(const std::string& name, const std::vector<int64_t>& shape,
const std::vector<int8_t>& data) {
return tensor_proto_new(name, shape, ONNX_NAMESPACE::TensorProto_DataType_INT4,
Expand Down
2 changes: 2 additions & 0 deletions onnxruntime/core/providers/vitisai/imp/tensor_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@
const std::vector<int16_t>& data);
ONNX_NAMESPACE::TensorProto* tensor_proto_new_doubles(const std::string& name, const std::vector<int64_t>& shape,
const std::vector<double>& data);
ONNX_NAMESPACE::TensorProto* tensor_proto_new_bool(const std::string& name, const std::vector<int64_t>& shape,

Check warning on line 40 in onnxruntime/core/providers/vitisai/imp/tensor_proto.h

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <string> for string [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/vitisai/imp/tensor_proto.h:40: Add #include <string> for string [build/include_what_you_use] [4]
const std::vector<uint8_t>& data);

Check warning on line 41 in onnxruntime/core/providers/vitisai/imp/tensor_proto.h

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <vector> for vector<> [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/vitisai/imp/tensor_proto.h:41: Add #include <vector> for vector<> [build/include_what_you_use] [4]
gsl::span<const char> process_ext_address(const ONNX_NAMESPACE::TensorProto& tensor);
} // namespace vaip
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace vaip_core {

#define VAIP_ORT_API_MAJOR (18u)
#define VAIP_ORT_API_MAJOR (19u)
#define VAIP_ORT_API_MINOR (0u)
#define VAIP_ORT_API_PATCH (0u)
struct OrtApiForVaip {
Expand Down Expand Up @@ -257,6 +257,9 @@
void (*graph_proto_delete)(GraphProto* p); // [107]
void (*graph_infer_shapes)(ModelProto& m); // [108]
DllSafe<std::string> (*graph_save_string)(const Graph& graph); // [109]
TensorProto* (*tensor_proto_new_bool)(const std::string& name,

Check warning on line 260 in onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <string> for string [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/vitisai/include/vaip/vaip_ort_api.h:260: Add #include <string> for string [build/include_what_you_use] [4]
const std::vector<int64_t>& shape,
const std::vector<uint8_t>& data); // [110]
};

#ifndef USE_VITISAI
Expand Down
Loading