forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathint_executable.hpp
81 lines (65 loc) · 2.39 KB
/
int_executable.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright (C) 2018-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <initializer_list>
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include "backend.hpp"
#include "openvino/core/model.hpp"
#include "openvino/op/non_max_suppression.hpp"
#include "openvino/op/parameter.hpp"
#include "openvino/op/result.hpp"
namespace ov {
namespace runtime {
namespace interpreter {
class INTBackend;
class INTExecutable : public Executable {
friend class INTBackend;
public:
INTExecutable(const std::shared_ptr<ov::Model>& model);
void cancel() override;
bool call(std::vector<ov::Tensor>& outputs,
const std::vector<ov::Tensor>& inputs,
bool collect_performance = false) override;
bool call(std::vector<ov::Tensor>& outputs,
const std::vector<ov::Tensor>& inputs,
const ov::EvaluationContext& context,
bool collect_performance = false) override;
ov::Tensor create_input_tensor(size_t input_index) override;
ov::Tensor create_output_tensor(size_t output_index) override;
std::vector<ov::Tensor> create_input_tensor(size_t input_index, size_t pipeline_depth) override;
std::vector<ov::Tensor> create_output_tensor(size_t output_index, size_t pipeline_depth) override;
std::shared_ptr<ov::Model> get_model() const override;
protected:
std::shared_ptr<ov::op::v0::Parameter> get_parameter(size_t index) const;
std::shared_ptr<ov::op::v0::Result> get_result(size_t index) const;
bool evaluate_node(const std::shared_ptr<Node>& node,
ov::TensorVector& outputs,
const ov::TensorVector& inputs) const;
bool m_is_compiled = false;
std::shared_ptr<ov::Model> m_model;
std::vector<std::shared_ptr<Node>> m_nodes;
std::atomic_bool m_cancel_execution{false};
std::mutex m_mutex;
struct InfoForNMS5 {
int64_t max_output_boxes_per_class;
float iou_threshold;
float score_threshold;
float soft_nms_sigma;
Shape out_shape;
Shape boxes_shape;
Shape scores_shape;
std::vector<float> boxes_data;
std::vector<float> scores_data;
size_t out_shape_size;
bool sort_result_descending;
ov::element::Type output_type;
};
};
} // namespace interpreter
} // namespace runtime
} // namespace ov