diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2018-02-13 15:24:04 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:47:18 +0000 |
commit | dde9ec96f471127e5b6d8dfaeffce024b6326f1a (patch) | |
tree | 3aa88c0dec625feeb9d17da825b87398cac6cc68 /arm_compute/graph | |
parent | e3fba0afa892c66379da1e3d3843f2155a1fb29a (diff) | |
download | ComputeLibrary-dde9ec96f471127e5b6d8dfaeffce024b6326f1a.tar.gz |
COMPMID-909: Enabling in-place computation for batchnormalization and activation at graph level
Change-Id: I84d4a212629b21794451ab5fb5c5b187b5e28f98
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/120127
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/graph')
-rw-r--r-- | arm_compute/graph/INode.h | 13 | ||||
-rw-r--r-- | arm_compute/graph/NodeContext.h | 4 | ||||
-rw-r--r-- | arm_compute/graph/nodes/BatchNormalizationLayer.h | 1 |
3 files changed, 15 insertions, 3 deletions
diff --git a/arm_compute/graph/INode.h b/arm_compute/graph/INode.h index 56b50b9424..1969423074 100644 --- a/arm_compute/graph/INode.h +++ b/arm_compute/graph/INode.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -58,6 +58,16 @@ public: * @return The updated target hint */ TargetHint override_target_hint(TargetHint target_hint) const; + /** Method to check if the node supports in-place operations. + * + * @return True if the node supports in-place operations, false otherwise. + */ + virtual bool supports_in_place() const; + /** Set the value of the _supports_in_place attribute. + * + * @param[in] value Boolean value to assign to _supports_in_place. + */ + void set_supports_in_place(bool value); protected: /** Interface to be implement that override the hints @@ -70,6 +80,7 @@ protected: protected: TargetHint _target_hint{ TargetHint::DONT_CARE }; + bool _supports_in_place{ false }; }; } // namespace graph } // namespace arm_compute diff --git a/arm_compute/graph/NodeContext.h b/arm_compute/graph/NodeContext.h index bc90f217a7..17ae49740b 100644 --- a/arm_compute/graph/NodeContext.h +++ b/arm_compute/graph/NodeContext.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -60,7 +60,7 @@ public: * @param[in] input Input to add */ void add_input(arm_compute::ITensor *input); - /** Adds and output to the context + /** Adds an output to the context * * @param[in] output Output to add */ diff --git a/arm_compute/graph/nodes/BatchNormalizationLayer.h b/arm_compute/graph/nodes/BatchNormalizationLayer.h index 266c3905d8..abbf09a54e 100644 --- a/arm_compute/graph/nodes/BatchNormalizationLayer.h +++ b/arm_compute/graph/nodes/BatchNormalizationLayer.h @@ -51,6 +51,7 @@ public: BatchNormalizationLayer(AccessorType &&mean, AccessorType &&var, AccessorType &&gamma, AccessorType &&beta, float epsilon, ActivationLayerInfo act_info = ActivationLayerInfo()) : _mean(std::move(mean)), _var(std::move(var)), _gamma(std::move(gamma)), _beta(std::move(beta)), _epsilon(epsilon), _act_info(act_info) { + set_supports_in_place(true); } // Inherited methods overriden: |