Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenzew committed Sep 13, 2024
1 parent 223a0c3 commit beeaf2f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions cmake/onnxruntime_providers_vitisai.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
file(GLOB onnxruntime_providers_vitisai_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/vitisai/*.cc"
"${ONNXRUNTIME_ROOT}/core/providers/vitisai/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/vitisai/include/vaip/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/vitisai/imp/*.cc"
"${ONNXRUNTIME_ROOT}/core/providers/vitisai/imp/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/shared_library/*.h"
Expand Down
3 changes: 2 additions & 1 deletion onnxruntime/core/providers/vitisai/include/vaip/custom_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ExecutionProvider {
virtual DllSafe<std::vector<std::string>> get_meta_def_nodes() const = 0;
virtual DllSafe<std::vector<std::string>>
get_meta_def_constant_initializer() const = 0;
virtual bool get_meta_def_fallback_CPU() const = 0;
virtual std::unique_ptr<CustomOp> compile() const = 0;

public:
Expand All @@ -44,7 +45,7 @@ class CustomOp {
VAIP_DLL_SPEC virtual ~CustomOp();

public:
virtual void Compute_base(const OrtApi* api, OrtKernelContext* context) const = 0;
virtual void Compute(const OrtApi* api, OrtKernelContext* context) const = 0;
};

} // namespace vaip_core
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct OrtApi;

namespace vaip_core {

#define VAIP_ORT_API_MAJOR (9u)
#define VAIP_ORT_API_MAJOR (10u)
#define VAIP_ORT_API_MINOR (0u)
#define VAIP_ORT_API_PATCH (0u)
struct OrtApiForVaip {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ common::Status VitisAIExecutionProvider::Compile(const std::vector<FusedNodeAndG
size_t index = attrs.at("index").i();
auto& ep = (**this->execution_providers_)[index];
ep->set_fused_node(&fused_node_graph.fused_node.get());
{
if (ep->get_meta_def_fallback_CPU()) {
auto& subgraph = fused_node_graph.filtered_graph.get();
auto& logger = logging::LoggingManager::DefaultLogger();
auto model_proto = subgraph.CreateModel(logger)->ToProto();
Expand All @@ -99,7 +99,7 @@ common::Status VitisAIExecutionProvider::Compile(const std::vector<FusedNodeAndG
}
};
compute_info.compute_func = [](FunctionState state, const OrtApi* api, OrtKernelContext* context) {
reinterpret_cast<vaip_core::CustomOp*>(state)->Compute_base(api, context);
reinterpret_cast<vaip_core::CustomOp*>(state)->Compute(api, context);
return Status::OK();
};
node_compute_funcs.push_back(compute_info);
Expand Down

0 comments on commit beeaf2f

Please sign in to comment.