Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 1 | /* |
| 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 Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame^] | 24 | #ifndef __ARM_COMPUTE_GRAPH_DETAIL_EXECUTION_HELPERS_H__ |
| 25 | #define __ARM_COMPUTE_GRAPH_DETAIL_EXECUTION_HELPERS_H__ |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 26 | |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame^] | 27 | #include "arm_compute/graph/Types.h" |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 28 | |
| 29 | namespace arm_compute |
| 30 | { |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame^] | 31 | namespace graph |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 32 | { |
| 33 | // Forward declarations |
| 34 | class Graph; |
| 35 | class GraphContext; |
| 36 | class ExecutionWorkload; |
| 37 | class Tensor; |
| 38 | |
| 39 | namespace detail |
| 40 | { |
| 41 | /** Initializes the available backends **/ |
| 42 | void default_initialize_backends(); |
| 43 | /** Configures all nodes of a graph |
| 44 | * |
| 45 | * @param[in] g Graph to configure |
| 46 | */ |
| 47 | void configure_all_tensors(Graph &g); |
| 48 | /** Allocates all tensors of a graph |
| 49 | * |
| 50 | * @param[in] g Graph to allocate the tensors |
| 51 | */ |
| 52 | void allocate_all_tensors(Graph &g); |
Georgios Pinitas | 2870516 | 2018-03-21 20:10:53 +0000 | [diff] [blame] | 53 | /** Validates all nodes |
| 54 | * |
| 55 | * @param[in] g Graph to validate |
| 56 | */ |
| 57 | void validate_all_nodes(Graph &g); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 58 | /** 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 | */ |
| 65 | ExecutionWorkload configure_all_nodes(Graph &g, GraphContext &ctx); |
Georgios Pinitas | 1562be3 | 2018-03-08 19:09:19 +0000 | [diff] [blame] | 66 | /** Release the memory of all unused const nodes |
| 67 | * |
| 68 | * @param[in] g Graph to release the memory from |
| 69 | */ |
| 70 | void release_unused_tensors(Graph &g); |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 71 | /** Calls accessor of a given tensor |
| 72 | * |
| 73 | * @param[in] tensor The tensor of which the accessor should be called |
| 74 | */ |
| 75 | void call_tensor_accessor(Tensor *tensor); |
| 76 | /** Call all const node accessors |
| 77 | * |
| 78 | * @param[in] g Graph containing the const nodes |
| 79 | */ |
| 80 | void call_all_const_node_accessors(Graph &g); |
| 81 | /** Call all input node accessors |
| 82 | * |
| 83 | * @param[in] workload Workload to execute |
| 84 | */ |
| 85 | void call_all_input_node_accessors(ExecutionWorkload &workload); |
| 86 | /** Call all output node accessors |
| 87 | * |
| 88 | * @param[in] workload Workload to execute |
| 89 | */ |
| 90 | void call_all_output_node_accessors(ExecutionWorkload &workload); |
| 91 | /** Executes all tasks of a workload |
| 92 | * |
| 93 | * @param[in] workload Workload to execute |
| 94 | */ |
| 95 | void call_all_tasks(ExecutionWorkload &workload); |
| 96 | } // namespace detail |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame^] | 97 | } // namespace graph |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 98 | } // namespace arm_compute |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame^] | 99 | #endif /* __ARM_COMPUTE_GRAPH_DETAIL_EXECUTION_HELPERS_H__ */ |