diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2017-10-04 16:53:58 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | ff421f2100e0e9e532f5fe78585300546af61690 (patch) | |
tree | 9ba5a1bfe64b5b10f70c64a965f9c5ca14de9ce3 /src/graph/Tensor.cpp | |
parent | 925ca0f7402115da3bffb21c04fca0bc822c9b38 (diff) | |
download | ComputeLibrary-ff421f2100e0e9e532f5fe78585300546af61690.tar.gz |
COMPMID-601: Add GraphContext
GraphContext hold all the information about the hints that need to be
passed in the nodes. As these might expand, it serves as a centralized
class for such information.
Change-Id: I0b5527630fb97cc5fa500db0bac8307ff2ea36e6
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/90300
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/graph/Tensor.cpp')
-rw-r--r-- | src/graph/Tensor.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/graph/Tensor.cpp b/src/graph/Tensor.cpp index c534ae0296..31dd4e86ac 100644 --- a/src/graph/Tensor.cpp +++ b/src/graph/Tensor.cpp @@ -21,7 +21,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - #include "arm_compute/graph/Tensor.h" #include "arm_compute/core/Error.h" @@ -53,7 +52,7 @@ void tensor_allocate(ITensor &tensor) } // namespace Tensor::Tensor(TensorInfo &&info) - : _target(Hint::DONT_CARE), _info(info), _accessor(nullptr), _tensor(nullptr) + : _target(TargetHint::DONT_CARE), _info(info), _accessor(nullptr), _tensor(nullptr) { } @@ -96,7 +95,7 @@ const TensorInfo &Tensor::info() const return _info; } -ITensor *Tensor::set_target(Hint target) +ITensor *Tensor::set_target(TargetHint target) { if(_tensor != nullptr) { @@ -106,14 +105,14 @@ ITensor *Tensor::set_target(Hint target) { switch(target) { - case Hint::OPENCL: + case TargetHint::OPENCL: _tensor = initialise_tensor<arm_compute::CLTensor>(_info); break; - case Hint::NEON: + case TargetHint::NEON: _tensor = initialise_tensor<arm_compute::Tensor>(_info); break; default: - ARM_COMPUTE_ERROR("Invalid Hint"); + ARM_COMPUTE_ERROR("Invalid TargetHint"); } _target = target; } @@ -125,14 +124,14 @@ void Tensor::allocate() ARM_COMPUTE_ERROR_ON_NULLPTR(_tensor.get()); switch(_target) { - case Hint::OPENCL: + case TargetHint::OPENCL: tensor_allocate<arm_compute::CLTensor>(*_tensor); break; - case Hint::NEON: + case TargetHint::NEON: tensor_allocate<arm_compute::Tensor>(*_tensor); break; default: - ARM_COMPUTE_ERROR("Invalid Hint"); + ARM_COMPUTE_ERROR("Invalid TargetHint"); } } @@ -145,7 +144,7 @@ void Tensor::allocate_and_fill_if_needed() } } -Hint Tensor::target() const +TargetHint Tensor::target() const { return _target; } |