aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/armnn/BackendHelper.hpp5
-rw-r--r--include/armnn/Descriptors.hpp24
-rw-r--r--include/armnn/DescriptorsFwd.hpp1
-rw-r--r--include/armnn/INetwork.hpp7
-rw-r--r--include/armnn/Types.hpp1
-rw-r--r--include/armnn/backends/WorkloadData.hpp7
-rw-r--r--include/armnnTestUtils/TensorHelpers.hpp9
7 files changed, 52 insertions, 2 deletions
diff --git a/include/armnn/BackendHelper.hpp b/include/armnn/BackendHelper.hpp
index ddf2308da2..6f804cbbed 100644
--- a/include/armnn/BackendHelper.hpp
+++ b/include/armnn/BackendHelper.hpp
@@ -360,6 +360,11 @@ public:
const ResizeDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
+ bool IsReverseV2Supported(const TensorInfo& input,
+ const TensorInfo& output,
+ const ReverseV2Descriptor& descriptor,
+ Optional<std::string&> reasonIfUnsupported = EmptyOptional());
+
bool IsShapeSupported(const TensorInfo& input,
const TensorInfo& output,
Optional<std::string&> reasonIfUnsupported = EmptyOptional());
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp
index 9ff894f1b0..27ca50123f 100644
--- a/include/armnn/Descriptors.hpp
+++ b/include/armnn/Descriptors.hpp
@@ -1620,4 +1620,28 @@ struct BatchMatMulDescriptor : BaseDescriptor
const TensorShape& tensorShape);
};
+struct ReverseV2Descriptor : BaseDescriptor
+{
+ ReverseV2Descriptor()
+ : m_Axis()
+ , m_MaxDimension(4)
+ {}
+
+ ReverseV2Descriptor(std::vector<int32_t> axis)
+ : m_Axis(axis)
+ , m_MaxDimension(4)
+ {}
+
+ bool operator ==(const ReverseV2Descriptor& rhs) const
+ {
+ return m_Axis == rhs.m_Axis;
+ }
+
+ /// The indices of the dimensions to reverse
+ std::vector<int32_t> m_Axis;
+ /// The max dimension supported in the lower levels of code
+ uint32_t m_MaxDimension;
+
+};
+
} // namespace armnn
diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp
index 2c25a49f00..4e9621d020 100644
--- a/include/armnn/DescriptorsFwd.hpp
+++ b/include/armnn/DescriptorsFwd.hpp
@@ -42,6 +42,7 @@ struct QLstmDescriptor;
struct ReshapeDescriptor;
struct ResizeDescriptor;
struct ReduceDescriptor;
+struct ReverseV2Descriptor;
struct SliceDescriptor;
struct SoftmaxDescriptor;
struct SpaceToBatchNdDescriptor;
diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp
index 819f5cb1a3..9b8c3b0b7b 100644
--- a/include/armnn/INetwork.hpp
+++ b/include/armnn/INetwork.hpp
@@ -825,6 +825,13 @@ public:
IConnectableLayer* AddBatchMatMulLayer(const BatchMatMulDescriptor& descriptor,
const char* name = nullptr);
+ /// Add a ReverseV2 layer to the network
+ /// @param descriptor - Parameters for the ReverseV2 operation
+ /// @param name - Optional name for the layer
+ /// @return - Interface for configuring the layer
+ IConnectableLayer* AddReverseV2Layer(const ReverseV2Descriptor& descriptor,
+ const char* name = nullptr);
+
void ExecuteStrategy(IStrategy& strategy) const;
protected:
diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp
index 117a679973..f05f05b2a0 100644
--- a/include/armnn/Types.hpp
+++ b/include/armnn/Types.hpp
@@ -473,6 +473,7 @@ using InferenceTimingPair = std::pair<HighResolutionClock, HighResolutionClock>;
X(GatherNd) \
X(BatchMatMul) \
X(ElementwiseBinary) \
+ X(ReverseV2) \
// New layers should be added at last position to minimize instability.
diff --git a/include/armnn/backends/WorkloadData.hpp b/include/armnn/backends/WorkloadData.hpp
index 2abd26740a..fe59fca795 100644
--- a/include/armnn/backends/WorkloadData.hpp
+++ b/include/armnn/backends/WorkloadData.hpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2021-2022 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2021-2023 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
@@ -750,4 +750,9 @@ struct BatchMatMulQueueDescriptor : QueueDescriptorWithParameters<BatchMatMulDes
void Validate(const WorkloadInfo& workloadInfo) const;
};
+struct ReverseV2QueueDescriptor : QueueDescriptorWithParameters<ReverseV2Descriptor>
+{
+ void Validate(const WorkloadInfo& workloadInfo) const;
+};
+
} // namespace armnn
diff --git a/include/armnnTestUtils/TensorHelpers.hpp b/include/armnnTestUtils/TensorHelpers.hpp
index ca17e621c3..fa9c97032c 100644
--- a/include/armnnTestUtils/TensorHelpers.hpp
+++ b/include/armnnTestUtils/TensorHelpers.hpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2017, 2021-2023 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
@@ -88,6 +88,13 @@ armnn::PredicateResult CompareTensors(const std::vector<T>& actualData,
return res;
}
+ // Support for comparison between empty tensors
+ if (actualData.size() == 0 && expectedData.size() == 0)
+ {
+ armnn::PredicateResult comparisonResult(true);
+ return comparisonResult;
+ }
+
if (actualShape.GetNumDimensions() != expectedShape.GetNumDimensions())
{
armnn::PredicateResult res(false);