Imported Upstream version 1.7.0
[platform/core/ml/nnfw.git] / runtime / onert / core / include / exec / IExecutor.h
index 8ae4926..46e05a2 100644 (file)
@@ -25,6 +25,7 @@
 #include "IFunction.h"
 #include "IODescription.h"
 #include "ir/OperationIndexMap.h"
+#include "backend/IDynamicTensorManager.h"
 
 namespace onert
 {
@@ -66,6 +67,25 @@ struct IExecutor
   virtual void execute(const IODescription &desc) = 0;
 };
 
+using ExecutorMap = std::unordered_map<ir::SubgraphIndex, std::unique_ptr<IExecutor>>;
+
+// TODO Move this structure to suitable place
+/**
+ * @brief Dynamic allocation info for input tensors
+ *        When user sets shape of input having unknown dims after compilation, memory for the input
+ * should be allocated before executing kernels. This struct contains information to allocate
+ * memory.
+ */
+struct DynAllocInfo
+{
+  /// @brief index of input tensor whose memory needs to be allocated at execution time
+  ir::OperandIndex ind;
+  /// @brief dynamic tensor manager that can allocate memory when input tensor is dynamic
+  backend::IDynamicTensorManager *dyn_tensor_manager;
+};
+
+using DynAllocInfoMap = std::unordered_map<std::shared_ptr<backend::ITensor>, DynAllocInfo>;
+
 } // namespace exec
 } // namespace onert