aboutsummaryrefslogtreecommitdiff
path: root/src/backends/ArmComputeTensorUtils.hpp
diff options
context:
space:
mode:
authorFrancis Murtagh <francis.murtagh@arm.com>2018-09-24 15:01:18 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-10 16:16:57 +0100
commit351d13d0b5fa698b72130012b2f069d30b911cb3 (patch)
treeb9417a78336e3e1b4c7d8775a2b3fd5bce0d624a /src/backends/ArmComputeTensorUtils.hpp
parent2ca4696639c9d2361b24adbd9a33225d18527fde (diff)
downloadarmnn-351d13d0b5fa698b72130012b2f069d30b911cb3.tar.gz
IVGCVSW-1888 Plumb data layout parameter for Convolution2D
* Added the DataLayout parameter to the Convolution2dDescriptor * Added the DataLayout parameter the Convolution2dQueueDescriptor * Set the DataLayout on the Descriptor in CreateWorkload() * Added overloaded factory methods for CreateTensorHandle() * Updated BuildArmComputeTensorInfo() to take DataLayout parameter. * Updated handles to take DataLayout parameter * Updated (Cl/Neon)Convolution2dWorkloadValidate * Updated (Cl/Neon)Convolution2dFloatWorkload * Updated (Cl/Neon)Convolution2dUint8Workload Change-Id: I8410668b3d727ca587bee66755cc4c4c78422f1f
Diffstat (limited to 'src/backends/ArmComputeTensorUtils.hpp')
-rw-r--r--src/backends/ArmComputeTensorUtils.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/backends/ArmComputeTensorUtils.hpp b/src/backends/ArmComputeTensorUtils.hpp
index 572e310ecf..18f41ee173 100644
--- a/src/backends/ArmComputeTensorUtils.hpp
+++ b/src/backends/ArmComputeTensorUtils.hpp
@@ -30,6 +30,16 @@ arm_compute::TensorShape BuildArmComputeTensorShape(const armnn::TensorShape& te
/// armnn::ITensorInfo.
arm_compute::TensorInfo BuildArmComputeTensorInfo(const armnn::TensorInfo& tensorInfo);
+/// Utility function used to convert armnn::DataLayout to arm_compute::DataLayout
+/// armnn::DataLayout.
+arm_compute::DataLayout ConvertDataLayout(armnn::DataLayout dataLayout);
+
+/// Utility function used to setup an arm_compute::ITensorInfo object whose dimensions are based on the given
+/// armnn::ITensorInfo.
+/// armnn::DataLayout.
+arm_compute::TensorInfo BuildArmComputeTensorInfo(const armnn::TensorInfo& tensorInfo,
+ armnn::DataLayout dataLayout);
+
/// Utility function used to setup an arm_compute::PoolingLayerInfo object from an armnn::Pooling2dDescriptor.
arm_compute::PoolingLayerInfo BuildArmComputePoolingLayerInfo(const Pooling2dDescriptor& descriptor);
@@ -59,6 +69,13 @@ void BuildArmComputeTensor(Tensor& tensor, const armnn::TensorInfo& tensorInfo)
tensor.allocator()->init(BuildArmComputeTensorInfo(tensorInfo));
}
+/// Sets up the given ArmCompute tensor's dimensions based on the given ArmNN tensor.
+template <typename Tensor>
+void BuildArmComputeTensor(Tensor& tensor, const armnn::TensorInfo& tensorInfo, DataLayout dataLayout)
+{
+ tensor.allocator()->init(BuildArmComputeTensorInfo(tensorInfo, dataLayout));
+}
+
template <typename Tensor>
void InitialiseArmComputeTensorEmpty(Tensor& tensor)
{