aboutsummaryrefslogtreecommitdiff
path: root/src/graph/GraphContext.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2019-09-10 17:20:34 +0100
committerMichalis Spyrou <michalis.spyrou@arm.com>2019-09-26 10:17:30 +0000
commit1a569a30a2f456ff1a3e0a665201e1c3ab92df80 (patch)
tree9d68934f461579edefbe65246f6ee435aaa18808 /src/graph/GraphContext.cpp
parentf1cf394ae882e6e8fb2e0986f88d2548b82a85bb (diff)
downloadComputeLibrary-1a569a30a2f456ff1a3e0a665201e1c3ab92df80.tar.gz
COMPMID-2161 [NEON] Create IWeightManager class
Change-Id: I1a9a46da2f98e896b825099151b56d1d8271dd31 Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/1915 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/graph/GraphContext.cpp')
-rw-r--r--src/graph/GraphContext.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/graph/GraphContext.cpp b/src/graph/GraphContext.cpp
index 037b40b68b..c959d5e35c 100644
--- a/src/graph/GraphContext.cpp
+++ b/src/graph/GraphContext.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -32,13 +32,14 @@ namespace arm_compute
namespace graph
{
GraphContext::GraphContext()
- : _config(), _memory_managers()
+ : _config(), _memory_managers(), _weights_managers()
{
}
GraphContext::~GraphContext()
{
_memory_managers.clear();
+ _weights_managers.clear();
release_default_graph_context(*this);
}
@@ -74,6 +75,30 @@ std::map<Target, MemoryManagerContext> &GraphContext::memory_managers()
return _memory_managers;
}
+bool GraphContext::insert_weights_management_ctx(WeightsManagerContext &&weights_managers)
+{
+ Target target = weights_managers.target;
+
+ if(target != Target::NEON || _weights_managers.find(target) != std::end(_weights_managers))
+ {
+ return false;
+ }
+
+ _weights_managers[target] = std::move(weights_managers);
+
+ return true;
+}
+
+WeightsManagerContext *GraphContext::weights_management_ctx(Target target)
+{
+ return (_weights_managers.find(target) != std::end(_weights_managers)) ? &_weights_managers[target] : nullptr;
+}
+
+std::map<Target, WeightsManagerContext> &GraphContext::weights_managers()
+{
+ return _weights_managers;
+}
+
void GraphContext::finalize()
{
const size_t num_pools = 1;