blob: 52304d6836cdb8fac72abf96bd7f92237f1e06e5 [file] [log] [blame]
Georgios Pinitasd8734b52017-12-22 15:27:52 +00001/*
2 * Copyright (c) 2018 ARM Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010024#ifndef __ARM_COMPUTE_GRAPH_DETAIL_EXECUTION_HELPERS_H__
25#define __ARM_COMPUTE_GRAPH_DETAIL_EXECUTION_HELPERS_H__
Georgios Pinitasd8734b52017-12-22 15:27:52 +000026
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010027#include "arm_compute/graph/Types.h"
Georgios Pinitasd8734b52017-12-22 15:27:52 +000028
29namespace arm_compute
30{
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010031namespace graph
Georgios Pinitasd8734b52017-12-22 15:27:52 +000032{
33// Forward declarations
34class Graph;
35class GraphContext;
36class ExecutionWorkload;
37class Tensor;
38
39namespace detail
40{
41/** Initializes the available backends **/
42void default_initialize_backends();
43/** Configures all nodes of a graph
44 *
45 * @param[in] g Graph to configure
46 */
47void configure_all_tensors(Graph &g);
48/** Allocates all tensors of a graph
49 *
50 * @param[in] g Graph to allocate the tensors
51 */
52void allocate_all_tensors(Graph &g);
Georgios Pinitas28705162018-03-21 20:10:53 +000053/** Validates all nodes
54 *
55 * @param[in] g Graph to validate
56 */
57void validate_all_nodes(Graph &g);
Georgios Pinitasd8734b52017-12-22 15:27:52 +000058/** Configures all nodes of graph
59 *
60 * @param[in] g Graph to configure the nodes
61 * @param[in] ctx Graph context to use
62 *
63 * @return The execution workload
64 */
65ExecutionWorkload configure_all_nodes(Graph &g, GraphContext &ctx);
Georgios Pinitas1562be32018-03-08 19:09:19 +000066/** Release the memory of all unused const nodes
67 *
68 * @param[in] g Graph to release the memory from
69 */
70void release_unused_tensors(Graph &g);
Georgios Pinitasd8734b52017-12-22 15:27:52 +000071/** Calls accessor of a given tensor
72 *
73 * @param[in] tensor The tensor of which the accessor should be called
74 */
75void call_tensor_accessor(Tensor *tensor);
76/** Call all const node accessors
77 *
78 * @param[in] g Graph containing the const nodes
79 */
80void call_all_const_node_accessors(Graph &g);
81/** Call all input node accessors
82 *
83 * @param[in] workload Workload to execute
84 */
85void call_all_input_node_accessors(ExecutionWorkload &workload);
86/** Call all output node accessors
87 *
88 * @param[in] workload Workload to execute
89 */
90void call_all_output_node_accessors(ExecutionWorkload &workload);
91/** Executes all tasks of a workload
92 *
93 * @param[in] workload Workload to execute
94 */
95void call_all_tasks(ExecutionWorkload &workload);
96} // namespace detail
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010097} // namespace graph
Georgios Pinitasd8734b52017-12-22 15:27:52 +000098} // namespace arm_compute
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010099#endif /* __ARM_COMPUTE_GRAPH_DETAIL_EXECUTION_HELPERS_H__ */