diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-04-03 13:44:29 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:49:16 +0000 |
commit | d9eb27597eabe5b7c17520f4f9b3f8a282d72573 (patch) | |
tree | 9b2b7d74b0ef83623b18d6d4279a564e5b63d641 /src/graph/GraphContext.cpp | |
parent | a8ca2b0cfe052c9a28b691317a674f28f495c139 (diff) | |
download | ComputeLibrary-d9eb27597eabe5b7c17520f4f9b3f8a282d72573.tar.gz |
COMPMID-797: Switch to new graph.
- Cleaned up build system
Change-Id: If2faa27ee5b31fa8b972836960ab3ef671059c8d
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/126435
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'src/graph/GraphContext.cpp')
-rw-r--r-- | src/graph/GraphContext.cpp | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/src/graph/GraphContext.cpp b/src/graph/GraphContext.cpp index bfc6fcdfca..6fc45c0aa7 100644 --- a/src/graph/GraphContext.cpp +++ b/src/graph/GraphContext.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -22,45 +22,53 @@ * SOFTWARE. */ #include "arm_compute/graph/GraphContext.h" +#include <arm_compute/graph.h> -using namespace arm_compute::graph; - -GraphHints::GraphHints(TargetHint target_hint, ConvolutionMethodHint conv_method_hint) - : _target_hint(target_hint), _convolution_method_hint(conv_method_hint) +namespace arm_compute { -} - -void GraphHints::set_target_hint(TargetHint target_hint) +namespace graph { - _target_hint = target_hint; -} - -void GraphHints::set_convolution_method_hint(ConvolutionMethodHint convolution_method) +GraphContext::GraphContext() + : _config(), _memory_managers() { - _convolution_method_hint = convolution_method; } -TargetHint GraphHints::target_hint() const +const GraphConfig &GraphContext::config() const { - return _target_hint; + return _config; } -ConvolutionMethodHint GraphHints::convolution_method_hint() const +void GraphContext::set_config(const GraphConfig &config) { - return _convolution_method_hint; + _config = config; } -GraphContext::GraphContext() - : _hints() +bool GraphContext::insert_memory_management_ctx(MemoryManagerContext &&memory_ctx) { + Target target = memory_ctx.target; + if(target == Target::UNSPECIFIED || _memory_managers.find(target) != std::end(_memory_managers)) + { + return false; + } + + _memory_managers[target] = std::move(memory_ctx); + return true; } -GraphHints &GraphContext::hints() +MemoryManagerContext *GraphContext::memory_management_ctx(Target target) { - return _hints; + return (_memory_managers.find(target) != std::end(_memory_managers)) ? &_memory_managers[target] : nullptr; } -const GraphHints &GraphContext::hints() const +void GraphContext::finalize() { - return _hints; -}
\ No newline at end of file + for(auto &mm_obj : _memory_managers) + { + if(mm_obj.second.mm != nullptr) + { + mm_obj.second.mm->finalize(); + } + } +} +} // namespace graph +} // namespace arm_compute
\ No newline at end of file |