blob: acd1654a064090e9293030c72e6bb3daa3f40219 [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 */
24#ifndef __ARM_COMPUTE_GRAPH2_DETAIL_EXECUTION_HELPERS_H__
25#define __ARM_COMPUTE_GRAPH2_DETAIL_EXECUTION_HELPERS_H__
26
27#include "arm_compute/graph2/Types.h"
28
29namespace arm_compute
30{
31namespace graph2
32{
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);
53/** Configures all nodes of graph
54 *
55 * @param[in] g Graph to configure the nodes
56 * @param[in] ctx Graph context to use
57 *
58 * @return The execution workload
59 */
60ExecutionWorkload configure_all_nodes(Graph &g, GraphContext &ctx);
61/** Calls accessor of a given tensor
62 *
63 * @param[in] tensor The tensor of which the accessor should be called
64 */
65void call_tensor_accessor(Tensor *tensor);
66/** Call all const node accessors
67 *
68 * @param[in] g Graph containing the const nodes
69 */
70void call_all_const_node_accessors(Graph &g);
71/** Call all input node accessors
72 *
73 * @param[in] workload Workload to execute
74 */
75void call_all_input_node_accessors(ExecutionWorkload &workload);
76/** Call all output node accessors
77 *
78 * @param[in] workload Workload to execute
79 */
80void call_all_output_node_accessors(ExecutionWorkload &workload);
81/** Executes all tasks of a workload
82 *
83 * @param[in] workload Workload to execute
84 */
85void call_all_tasks(ExecutionWorkload &workload);
86} // namespace detail
87} // namespace graph2
88} // namespace arm_compute
89#endif /* __ARM_COMPUTE_GRAPH2_DETAIL_EXECUTION_HELPERS_H__ */