diff options
Diffstat (limited to 'src/graph/GraphManager.cpp')
-rw-r--r-- | src/graph/GraphManager.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/graph/GraphManager.cpp b/src/graph/GraphManager.cpp index e357f10401..58ae60d4cc 100644 --- a/src/graph/GraphManager.cpp +++ b/src/graph/GraphManager.cpp @@ -23,30 +23,32 @@ */ #include "arm_compute/graph/GraphManager.h" +#include "arm_compute/graph/algorithms/TopologicalSort.h" +#include "arm_compute/graph/detail/CrossLayerMemoryManagerHelpers.h" +#include "arm_compute/graph/detail/ExecutionHelpers.h" #include "arm_compute/graph/Graph.h" #include "arm_compute/graph/GraphContext.h" #include "arm_compute/graph/Logger.h" #include "arm_compute/graph/PassManager.h" #include "arm_compute/graph/TypePrinter.h" #include "arm_compute/graph/Utils.h" -#include "arm_compute/graph/detail/CrossLayerMemoryManagerHelpers.h" -#include "arm_compute/graph/detail/ExecutionHelpers.h" -#include "arm_compute/graph/algorithms/TopologicalSort.h" +#include "src/common/utils/Log.h" namespace arm_compute { namespace graph { -GraphManager::GraphManager() - : _workloads() +GraphManager::GraphManager() : _workloads() { } void GraphManager::finalize_graph(Graph &graph, GraphContext &ctx, PassManager &pm, Target target) { + ARM_COMPUTE_LOG_INFO_WITH_FUNCNAME_ACL("Initiate graph configuration!"); + // Check if graph has been registered - if(_workloads.find(graph.id()) != std::end(_workloads)) + if (_workloads.find(graph.id()) != std::end(_workloads)) { ARM_COMPUTE_ERROR("Graph is already registered!"); } @@ -59,7 +61,7 @@ void GraphManager::finalize_graph(Graph &graph, GraphContext &ctx, PassManager & // In case CLVK is selected, use the CL backend and // update config - if(target == Target::CLVK) + if (target == Target::CLVK) { forced_target = Target::CL; GraphConfig config = ctx.config(); @@ -68,7 +70,7 @@ void GraphManager::finalize_graph(Graph &graph, GraphContext &ctx, PassManager & ctx.set_config(config); } - if(!is_target_supported(target)) + if (!is_target_supported(target)) { forced_target = get_default_target(); ARM_COMPUTE_LOG_GRAPH_INFO("Switching target from " << target << " to " << forced_target << std::endl); @@ -102,7 +104,7 @@ void GraphManager::finalize_graph(Graph &graph, GraphContext &ctx, PassManager & detail::prepare_all_tasks(workload); // Setup tensor memory (Allocate all tensors or setup transition manager) - if(ctx.config().use_transition_memory_manager) + if (ctx.config().use_transition_memory_manager) { detail::configure_transition_manager(graph, ctx, workload); } @@ -121,14 +123,16 @@ void GraphManager::finalize_graph(Graph &graph, GraphContext &ctx, PassManager & void GraphManager::execute_graph(Graph &graph) { + ARM_COMPUTE_LOG_INFO_WITH_FUNCNAME_ACL("Initiate graph execution!"); + // Check if graph is finalized auto it = _workloads.find(graph.id()); ARM_COMPUTE_ERROR_ON_MSG(it == std::end(_workloads), "Graph is not registered!"); - while(true) + while (true) { // Call input accessors - if(!detail::call_all_input_node_accessors(it->second)) + if (!detail::call_all_input_node_accessors(it->second)) { return; } @@ -137,7 +141,7 @@ void GraphManager::execute_graph(Graph &graph) detail::call_all_tasks(it->second); // Call output accessors - if(!detail::call_all_output_node_accessors(it->second)) + if (!detail::call_all_output_node_accessors(it->second)) { return; } @@ -152,4 +156,4 @@ void GraphManager::invalidate_graph(Graph &graph) _workloads.erase(it); } } // namespace graph -} // namespace arm_compute
\ No newline at end of file +} // namespace arm_compute |