diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-05-03 20:47:16 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:51:50 +0000 |
commit | 3d1489de593574e65ef1e64a7ae64e4e56c2978b (patch) | |
tree | f87f3df521cb5ed8bd383dad89cbeb92c49670ac /src/graph/GraphManager.cpp | |
parent | 54d6fae4dbb4f556cc5ec484c51681ad84c015a7 (diff) | |
download | ComputeLibrary-3d1489de593574e65ef1e64a7ae64e4e56c2978b.tar.gz |
COMPMID-605: Transition buffer memory manager
Change-Id: Ide7c6124eb19f13f15f517e62d705646a0cd1ecd
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/130184
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/graph/GraphManager.cpp')
-rw-r--r-- | src/graph/GraphManager.cpp | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/graph/GraphManager.cpp b/src/graph/GraphManager.cpp index aac6488311..a67e5b25d6 100644 --- a/src/graph/GraphManager.cpp +++ b/src/graph/GraphManager.cpp @@ -28,6 +28,7 @@ #include "arm_compute/graph/Logger.h" #include "arm_compute/graph/PassManager.h" #include "arm_compute/graph/Utils.h" +#include "arm_compute/graph/detail/CrossLayerMemoryManagerHelpers.h" #include "arm_compute/graph/detail/ExecutionHelpers.h" namespace arm_compute @@ -72,41 +73,37 @@ void GraphManager::finalize_graph(Graph &graph, GraphContext &ctx, PassManager & auto workload = detail::configure_all_nodes(graph, ctx); ARM_COMPUTE_ERROR_ON_MSG(workload.tasks.empty(), "Could not configure all nodes!"); + // Allocate const tensors and call accessors + detail::allocate_const_tensors(graph); + detail::call_all_const_node_accessors(graph); + // TODO (COMPMID-920) : Update prepare for NEON/GC if(forced_target == Target::CL) { - // Allocate const tensors and call accessors - detail::allocate_const_tensors(graph); - detail::call_all_const_node_accessors(graph); - // Prepare graph detail::prepare_all_tasks(workload); + } - // Allocate all tensors - detail::allocate_all_tensors(graph); - - // Finalize Graph context - ctx.finalize(); - - // Register graph - _workloads.insert(std::make_pair(graph.id(), std::move(workload))); - ARM_COMPUTE_LOG_GRAPH_VERBOSE("Created workload for graph with ID : " << graph.id().get() << std::endl); + // Setup tensor memory (Allocate all tensors or setup transition manager) + if(ctx.config().use_transition_memory_manager) + { + detail::configure_transition_manager(graph, ctx, workload); } else { - // Allocate all tensors detail::allocate_all_tensors(graph); + } - // Call accessors on all Const nodes - detail::call_all_const_node_accessors(graph); - - // Finalize Graph context - ctx.finalize(); + // Finalize Graph context + ctx.finalize(); - // Register graph - _workloads.insert(std::make_pair(graph.id(), std::move(workload))); - ARM_COMPUTE_LOG_GRAPH_VERBOSE("Created workload for graph with ID : " << graph.id().get() << std::endl); + // Register graph + _workloads.insert(std::make_pair(graph.id(), std::move(workload))); + ARM_COMPUTE_LOG_GRAPH_VERBOSE("Created workload for graph with ID : " << graph.id().get() << std::endl); + // TODO (COMPMID-920) : Update prepare for NEON/GC + if(forced_target != Target::CL) + { // Make first run execute_graph(graph); |