diff options
Diffstat (limited to 'compiler/luci-interpreter/src/core/RuntimeGraph.h')
-rw-r--r-- | compiler/luci-interpreter/src/core/RuntimeGraph.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler/luci-interpreter/src/core/RuntimeGraph.h b/compiler/luci-interpreter/src/core/RuntimeGraph.h index 6ddbea4e9..8184e249d 100644 --- a/compiler/luci-interpreter/src/core/RuntimeGraph.h +++ b/compiler/luci-interpreter/src/core/RuntimeGraph.h @@ -18,6 +18,7 @@ #define LUCI_INTERPRETER_CORE_RUNTIMEGRAPH_H #include "luci_interpreter/core/Tensor.h" +#include "luci_interpreter/MemoryManager.h" #include "core/Kernel.h" #include <memory> @@ -30,14 +31,21 @@ class RuntimeModule; class RuntimeGraph { +private: + class TensorAllocPlan; + friend class TensorAllocPlan; + public: - explicit RuntimeGraph(RuntimeModule *owning_module) : _owning_module(owning_module) {} + explicit RuntimeGraph(RuntimeModule *owning_module, IMemoryManager *memory_manager); + ~RuntimeGraph(); Tensor *addTensor(std::unique_ptr<Tensor> &&tensor); void setInputTensors(const std::vector<Tensor *> &input_tensors); void setOutputTensors(const std::vector<Tensor *> &output_tensors); + void configureAllocations(Tensor *tensor); + const std::vector<Tensor *> &getInputTensors() const { return _input_tensors; } const std::vector<Tensor *> &getOutputTensors() const { return _output_tensors; } @@ -46,6 +54,7 @@ public: void execute() const; private: + IMemoryManager *_memory_manager; RuntimeModule *_owning_module; std::vector<std::unique_ptr<Tensor>> _tensors; std::vector<Tensor *> _input_tensors; @@ -53,6 +62,8 @@ private: // Kernels in execution order. std::vector<std::unique_ptr<Kernel>> _kernels; + // Tensors that are not used anymore after given op + std::unique_ptr<TensorAllocPlan> _tensor_alloc_plan; }; } // namespace luci_interpreter |