aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/graph
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/graph')
-rw-r--r--arm_compute/graph/Workload.h11
-rw-r--r--arm_compute/graph/detail/ExecutionHelpers.h21
2 files changed, 29 insertions, 3 deletions
diff --git a/arm_compute/graph/Workload.h b/arm_compute/graph/Workload.h
index b19c932636..11bb22ea9a 100644
--- a/arm_compute/graph/Workload.h
+++ b/arm_compute/graph/Workload.h
@@ -37,6 +37,7 @@ namespace graph
class ITensorHandle;
class INode;
class Tensor;
+class Graph;
/** Execution task
*
@@ -52,14 +53,18 @@ struct ExecutionTask
/** Function operator */
void operator()();
+
+ /** Prepare execution task */
+ void prepare();
};
/** Execution workload */
struct ExecutionWorkload
{
- std::vector<Tensor *> inputs = {}; /**< Input handles */
- std::vector<Tensor *> outputs = {}; /**< Output handles */
- std::vector<ExecutionTask> tasks = {}; /**< Execution workload */
+ std::vector<Tensor *> inputs = {}; /**< Input handles */
+ std::vector<Tensor *> outputs = {}; /**< Output handles */
+ std::vector<ExecutionTask> tasks = {}; /**< Execution workload */
+ Graph *graph = nullptr; /**< Graph bound to the workload */
};
} // namespace graph
} // namespace arm_compute
diff --git a/arm_compute/graph/detail/ExecutionHelpers.h b/arm_compute/graph/detail/ExecutionHelpers.h
index 52304d6836..a868df8a5d 100644
--- a/arm_compute/graph/detail/ExecutionHelpers.h
+++ b/arm_compute/graph/detail/ExecutionHelpers.h
@@ -35,6 +35,7 @@ class Graph;
class GraphContext;
class ExecutionWorkload;
class Tensor;
+class INode;
namespace detail
{
@@ -45,6 +46,21 @@ void default_initialize_backends();
* @param[in] g Graph to configure
*/
void configure_all_tensors(Graph &g);
+/** Allocates all input tensors of a node.
+ *
+ * @param[in] node Node to allocate the input tensor of
+ */
+void allocate_all_input_tensors(INode &node);
+/** Allocates all output tensors of a node.
+ *
+ * @param[in] node Node to allocate the output tensor of
+ */
+void allocate_all_output_tensors(INode &node);
+/** Allocates const tensor of a given graph
+ *
+ * @param[in] g Graph to allocate the tensors
+ */
+void allocate_const_tensors(Graph &g);
/** Allocates all tensors of a graph
*
* @param[in] g Graph to allocate the tensors
@@ -88,6 +104,11 @@ void call_all_input_node_accessors(ExecutionWorkload &workload);
* @param[in] workload Workload to execute
*/
void call_all_output_node_accessors(ExecutionWorkload &workload);
+/** Prepares all tasks for execution
+ *
+ * @param[in] workload Workload to prepare
+ */
+void prepare_all_tasks(ExecutionWorkload &workload);
/** Executes all tasks of a workload
*
* @param[in] workload Workload to execute