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
diff --git a/src/backends/cl/ClTensorHandleFactory.cpp b/src/backends/cl/ClTensorHandleFactory.cpp
index 237f27a..b8ee57f 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 @@
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 @@
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 @@
return m_ImportFlags;
}
-} // namespace armnn
\ No newline at end of file
+} // namespace armnn
\ No newline at end of file