diff options
author | Colm Donelan <Colm.Donelan@arm.com> | 2021-03-12 15:58:48 +0000 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2021-03-23 13:59:15 +0000 |
commit | c74b1750fe8cf7affdbc59edd53357e0ea4efa53 (patch) | |
tree | fc925b928147f70016605a0c123066cfdf9c15a1 /src/backends/cl/ClTensorHandleFactory.cpp | |
parent | 4441d94fa0a97d4137e49315d69d32fdc0bbcd03 (diff) | |
download | armnn-c74b1750fe8cf7affdbc59edd53357e0ea4efa53.tar.gz |
IVGCVSW-5724 Add import tensor handling as ClImportTensorHandleFactory.
* Add new ClImportTensorHandlefactory for tensor import.
* Add unit tests.
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: I61884fed65e764ebd6985fe0833e43a7296d0641
Diffstat (limited to 'src/backends/cl/ClTensorHandleFactory.cpp')
-rw-r--r-- | src/backends/cl/ClTensorHandleFactory.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/backends/cl/ClTensorHandleFactory.cpp b/src/backends/cl/ClTensorHandleFactory.cpp index 237f27a4ed..b8ee57f0bf 100644 --- a/src/backends/cl/ClTensorHandleFactory.cpp +++ b/src/backends/cl/ClTensorHandleFactory.cpp @@ -3,17 +3,15 @@ // SPDX-License-Identifier: MIT // - #include "ClTensorHandleFactory.hpp" #include "ClTensorHandle.hpp" #include <armnn/utility/NumericCast.hpp> #include <armnn/utility/PolymorphicDowncast.hpp> -#include <arm_compute/runtime/CL/CLTensor.h> #include <arm_compute/core/Coordinates.h> #include <arm_compute/runtime/CL/CLSubTensor.h> - +#include <arm_compute/runtime/CL/CLTensor.h> namespace armnn { @@ -35,8 +33,7 @@ std::unique_ptr<ITensorHandle> ClTensorHandleFactory::CreateSubTensorHandle(ITen coords.set(i, armnn::numeric_cast<int>(subTensorOrigin[revertedIndex])); } - const arm_compute::TensorShape parentShape = armcomputetensorutils::BuildArmComputeTensorShape( - parent.GetShape()); + const arm_compute::TensorShape parentShape = armcomputetensorutils::BuildArmComputeTensorShape(parent.GetShape()); // In order for ACL to support subtensors the concat axis cannot be on x or y and the values of x and y // must match the parent shapes @@ -54,8 +51,7 @@ std::unique_ptr<ITensorHandle> ClTensorHandleFactory::CreateSubTensorHandle(ITen return nullptr; } - return std::make_unique<ClSubTensorHandle>( - PolymorphicDowncast<IClTensorHandle *>(&parent), shape, coords); + return std::make_unique<ClSubTensorHandle>(PolymorphicDowncast<IClTensorHandle*>(&parent), shape, coords); } std::unique_ptr<ITensorHandle> ClTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo) const @@ -120,4 +116,4 @@ MemorySourceFlags ClTensorHandleFactory::GetImportFlags() const return m_ImportFlags; } -} // namespace armnn
\ No newline at end of file +} // namespace armnn
\ No newline at end of file |