IVGCVSW-3124 Rename workloadFactory CreateMerger to CreateConcat
authorJim Flynn <jim.flynn@arm.com>
Mon, 20 May 2019 10:02:46 +0000 (11:02 +0100)
committerJim Flynn <jim.flynn@arm.com>
Mon, 20 May 2019 11:58:41 +0000 (12:58 +0100)
Change-Id: Id836372c0e4ef0c3996085facc4da6263366abcf
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
15 files changed:
src/armnn/layers/MergerLayer.cpp
src/backends/backendsCommon/WorkloadFactory.cpp
src/backends/backendsCommon/WorkloadFactory.hpp
src/backends/backendsCommon/test/IsLayerSupportedTestImpl.hpp
src/backends/backendsCommon/test/LayerTests.cpp
src/backends/backendsCommon/test/LayerTests.hpp
src/backends/cl/ClWorkloadFactory.cpp
src/backends/cl/ClWorkloadFactory.hpp
src/backends/cl/test/ClLayerTests.cpp
src/backends/neon/NeonWorkloadFactory.cpp
src/backends/neon/NeonWorkloadFactory.hpp
src/backends/neon/test/NeonLayerTests.cpp
src/backends/reference/RefWorkloadFactory.cpp
src/backends/reference/RefWorkloadFactory.hpp
src/backends/reference/test/RefLayerTests.cpp

index c674f64..9dbfdcc 100644 (file)
@@ -31,7 +31,7 @@ std::unique_ptr<IWorkload> MergerLayer::CreateWorkload(const Graph& graph, const
             std::vector<unsigned int>(m_Param.GetViewOrigin(i), m_Param.GetViewOrigin(i) + m_Param.GetNumDimensions()));
     }
 
-    return factory.CreateMerger(descriptor, PrepInfoAndDesc(descriptor, graph));
+    return factory.CreateConcat(descriptor, PrepInfoAndDesc(descriptor, graph));
 }
 
 void MergerLayer::CreateTensorHandles(Graph& graph, const IWorkloadFactory& factory)
index 9ed0e29..9679c35 100644 (file)
@@ -822,6 +822,12 @@ std::unique_ptr<IWorkload> IWorkloadFactory::CreateBatchToSpaceNd(const BatchToS
     return std::unique_ptr<IWorkload>();
 }
 
+std::unique_ptr<IWorkload> IWorkloadFactory::CreateConcat(const MergerQueueDescriptor& descriptor,
+                                                          const WorkloadInfo& info) const
+{
+    return std::unique_ptr<IWorkload>();
+}
+
 std::unique_ptr<IWorkload> IWorkloadFactory::CreateConstant(const ConstantQueueDescriptor& descriptor,
                                                             const WorkloadInfo& info) const
 {
index 5c07b3a..927d7e7 100644 (file)
@@ -61,6 +61,9 @@ public:
     virtual std::unique_ptr<IWorkload> CreateBatchToSpaceNd(const BatchToSpaceNdQueueDescriptor& descriptor,
                                                             const WorkloadInfo& Info) const;
 
+    virtual std::unique_ptr<IWorkload> CreateConcat(const MergerQueueDescriptor& descriptor,
+                                                    const WorkloadInfo&          info) const;
+
     virtual std::unique_ptr<IWorkload> CreateConstant(const ConstantQueueDescriptor& descriptor,
                                                       const WorkloadInfo& info) const;
 
@@ -124,6 +127,7 @@ public:
     virtual std::unique_ptr<IWorkload> CreateMerge(const MergeQueueDescriptor& descriptor,
                                                     const WorkloadInfo& info) const;
 
+    ARMNN_DEPRECATED_MSG("Use CreateConcat instead")
     virtual std::unique_ptr<IWorkload> CreateMerger(const MergerQueueDescriptor& descriptor,
                                                     const WorkloadInfo&          info) const;
 
index a7d7b09..3ff7376 100644 (file)
@@ -364,7 +364,9 @@ DECLARE_LAYER_POLICY_2_PARAM(Mean)
 
 DECLARE_LAYER_POLICY_1_PARAM(Merge)
 
+ARMNN_NO_DEPRECATE_WARN_BEGIN
 DECLARE_LAYER_POLICY_2_PARAM(Merger)
+ARMNN_NO_DEPRECATE_WARN_END
 
 DECLARE_LAYER_POLICY_1_PARAM(Minimum)
 
index 52c9773..90aceee 100644 (file)
@@ -1244,7 +1244,7 @@ LayerTestResult<int16_t, 2> LstmLayerInt16NoCifgNoPeepholeNoProjectionInt16Const
         workloadFactory, memoryManager, input, expectedOutput, qScale, qOffset, datatype);
 }
 
-LayerTestResult<float,3> MergerTest(
+LayerTestResult<float,3> ConcatTest(
     armnn::IWorkloadFactory& workloadFactory,
     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager)
 {
@@ -1350,7 +1350,7 @@ LayerTestResult<float,3> MergerTest(
     data.m_ViewOrigins.push_back(window1);
     data.m_ViewOrigins.push_back(window2);
 
-    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateMerger(data, info);
+    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateConcat(data, info);
 
     inputHandle1->Allocate();
     inputHandle2->Allocate();
@@ -3560,7 +3560,7 @@ void Concatenate(
 
     AddOutputToWorkload(queueDescriptor, workloadInfo, outputTensorInfo, outputHandle.get());
 
-    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateMerger(queueDescriptor, workloadInfo);
+    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateConcat(queueDescriptor, workloadInfo);
 
     for (auto& inputHandle : inputHandles)
     {
@@ -6487,7 +6487,7 @@ LayerTestResult<uint8_t, 4> ConstantUint8SimpleQuantizationScaleNoOffsetTest(
     return ConstantTestImpl<armnn::DataType::QuantisedAsymm8>(workloadFactory, memoryManager, 1.0f, 0);
 }
 
-LayerTestResult<uint8_t, 3> MergerUint8DifferentQParamsTest(
+LayerTestResult<uint8_t, 3> ConcatUint8DifferentQParamsTest(
         armnn::IWorkloadFactory& workloadFactory,
         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager)
 {
@@ -6613,7 +6613,7 @@ LayerTestResult<uint8_t, 3> MergerUint8DifferentQParamsTest(
     data.m_ViewOrigins.push_back(window1);
     data.m_ViewOrigins.push_back(window2);
 
-    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateMerger(data, info);
+    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateConcat(data, info);
 
     inputHandle1->Allocate();
     inputHandle2->Allocate();
@@ -6630,7 +6630,7 @@ LayerTestResult<uint8_t, 3> MergerUint8DifferentQParamsTest(
     return ret;
 }
 
-LayerTestResult<uint8_t, 3> MergerUint8Test(
+LayerTestResult<uint8_t, 3> ConcatUint8Test(
     armnn::IWorkloadFactory& workloadFactory,
     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager)
 {
@@ -6651,7 +6651,7 @@ LayerTestResult<uint8_t, 3> MergerUint8Test(
     armnn::TensorInfo inputTensorInfo1({ inputChannels1, inputHeight1, inputWidth1 }, armnn::DataType::QuantisedAsymm8);
     armnn::TensorInfo inputTensorInfo2({ inputChannels2, inputHeight2, inputWidth2 }, armnn::DataType::QuantisedAsymm8);
 
-    // Arbitrary scale and offsets. They don't really matter as the merger operator doesn't dequantize/quantize them.
+    // Arbitrary scale and offsets. They don't really matter as the Concat operator doesn't dequantize/quantize them.
     const float scale = 0.13497836f;
     const int32_t offset = -7;
 
@@ -6749,7 +6749,7 @@ LayerTestResult<uint8_t, 3> MergerUint8Test(
     data.m_ViewOrigins.push_back(window1);
     data.m_ViewOrigins.push_back(window2);
 
-    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateMerger(data, info);
+    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateConcat(data, info);
 
     inputHandle1->Allocate();
     inputHandle2->Allocate();
@@ -6766,7 +6766,7 @@ LayerTestResult<uint8_t, 3> MergerUint8Test(
     return ret;
 }
 
-LayerTestResult<uint16_t, 3> MergerUint16Test(
+LayerTestResult<uint16_t, 3> ConcatUint16Test(
         armnn::IWorkloadFactory& workloadFactory,
         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager)
 {
@@ -6787,7 +6787,7 @@ LayerTestResult<uint16_t, 3> MergerUint16Test(
     armnn::TensorInfo inputTensorInfo1({ inputChannels1, inputHeight1, inputWidth1 }, armnn::DataType::QuantisedSymm16);
     armnn::TensorInfo inputTensorInfo2({ inputChannels2, inputHeight2, inputWidth2 }, armnn::DataType::QuantisedSymm16);
 
-    // Arbitrary scale and offsets. They don't really matter as the merger operator doesn't dequantize/quantize them.
+    // Arbitrary scale and offsets. They don't really matter as the Concat operator doesn't dequantize/quantize them.
     const float scale = 0.13497836f;
     const int32_t offset = -7;
 
@@ -6882,7 +6882,7 @@ LayerTestResult<uint16_t, 3> MergerUint16Test(
     data.m_ViewOrigins.push_back(window1);
     data.m_ViewOrigins.push_back(window2);
 
-    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateMerger(data, info);
+    std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateConcat(data, info);
 
     inputHandle1->Allocate();
     inputHandle2->Allocate();
index 76dc240..efd8c34 100644 (file)
@@ -540,7 +540,7 @@ LayerTestResult<float, 3> CopyViaSplitterTest(
     armnn::IWorkloadFactory& workloadFactory,
     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager);
 
-LayerTestResult<float, 3> MergerTest(
+LayerTestResult<float, 3> ConcatTest(
     armnn::IWorkloadFactory& workloadFactory,
     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager);
 
@@ -806,15 +806,15 @@ LayerTestResult<uint8_t, 3> CopyViaSplitterUint8Test(
     armnn::IWorkloadFactory& workloadFactory,
     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager);
 
-LayerTestResult<uint8_t, 3> MergerUint8Test(
+LayerTestResult<uint8_t, 3> ConcatUint8Test(
     armnn::IWorkloadFactory& workloadFactory,
     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager);
 
-LayerTestResult<uint16_t, 3> MergerUint16Test(
+LayerTestResult<uint16_t, 3> ConcatUint16Test(
     armnn::IWorkloadFactory& workloadFactory,
     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager);
 
-LayerTestResult<uint8_t, 3> MergerUint8DifferentQParamsTest(
+LayerTestResult<uint8_t, 3> ConcatUint8DifferentQParamsTest(
     armnn::IWorkloadFactory& workloadFactory,
     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager);
 
index 4009269..e7cf191 100644 (file)
@@ -158,7 +158,7 @@ std::unique_ptr<IWorkload> ClWorkloadFactory::CreateSplitter(const SplitterQueue
 std::unique_ptr<armnn::IWorkload> ClWorkloadFactory::CreateMerger(const MergerQueueDescriptor& descriptor,
                                                                   const WorkloadInfo&          info) const
 {
-    return MakeWorkload<ClConcatWorkload>(descriptor, info);
+    return CreateConcat(descriptor, info);
 }
 
 std::unique_ptr<armnn::IWorkload> ClWorkloadFactory::CreateFullyConnected(
@@ -265,6 +265,12 @@ std::unique_ptr<IWorkload> ClWorkloadFactory::CreateL2Normalization(const L2Norm
     return MakeWorkload<ClL2NormalizationFloatWorkload, NullWorkload>(descriptor, info);
 }
 
+std::unique_ptr<armnn::IWorkload> ClWorkloadFactory::CreateConcat(const MergerQueueDescriptor& descriptor,
+                                                                  const WorkloadInfo&          info) const
+{
+    return MakeWorkload<ClConcatWorkload>(descriptor, info);
+}
+
 std::unique_ptr<IWorkload> ClWorkloadFactory::CreateConstant(const ConstantQueueDescriptor& descriptor,
     const WorkloadInfo& info) const
 {
index 5ef7d08..e00672f 100644 (file)
@@ -51,6 +51,7 @@ public:
     std::unique_ptr<IWorkload> CreateSplitter(const SplitterQueueDescriptor& descriptor,
                                               const WorkloadInfo& info) const override;
 
+    ARMNN_DEPRECATED_MSG("Use CreateConcat instead")
     std::unique_ptr<IWorkload> CreateMerger(const MergerQueueDescriptor& descriptor,
                                             const WorkloadInfo& info) const override;
 
@@ -96,6 +97,9 @@ public:
     std::unique_ptr<IWorkload> CreateL2Normalization(const L2NormalizationQueueDescriptor& descriptor,
                                                      const WorkloadInfo& info) const override;
 
+    std::unique_ptr<IWorkload> CreateConcat(const MergerQueueDescriptor& descriptor,
+                                            const WorkloadInfo& info) const override;
+
     std::unique_ptr<IWorkload> CreateConstant(const ConstantQueueDescriptor& descriptor,
                                               const WorkloadInfo& info) const override;
 
index 4d58778..fe88b39 100644 (file)
@@ -130,9 +130,9 @@ ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test)
 ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest)
 ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test)
 
-// Merger
-ARMNN_AUTO_TEST_CASE(SimpleMerger, MergerTest)
-ARMNN_AUTO_TEST_CASE(MergerUint8, MergerUint8Test)
+// Concat
+ARMNN_AUTO_TEST_CASE(SimpleConcat, ConcatTest)
+ARMNN_AUTO_TEST_CASE(ConcatUint8, ConcatUint8Test)
 
 // Normalization
 ARMNN_AUTO_TEST_CASE(SimpleNormalizationAcross, SimpleNormalizationAcrossTest)
index c49ff3a..3005dae 100644 (file)
@@ -123,7 +123,7 @@ std::unique_ptr<IWorkload> NeonWorkloadFactory::CreateSplitter(const SplitterQue
 std::unique_ptr<armnn::IWorkload> NeonWorkloadFactory::CreateMerger(const MergerQueueDescriptor& descriptor,
                                                                     const WorkloadInfo&          info) const
 {
-    return std::make_unique<NeonConcatWorkload>(descriptor, info);
+    return CreateConcat(descriptor, info);
 }
 
 std::unique_ptr<armnn::IWorkload> NeonWorkloadFactory::CreateFullyConnected(
@@ -233,6 +233,12 @@ std::unique_ptr<IWorkload> NeonWorkloadFactory::CreateL2Normalization(const L2No
         m_MemoryManager->GetIntraLayerManager());
 }
 
+std::unique_ptr<armnn::IWorkload> NeonWorkloadFactory::CreateConcat(const MergerQueueDescriptor& descriptor,
+                                                                    const WorkloadInfo&          info) const
+{
+    return std::make_unique<NeonConcatWorkload>(descriptor, info);
+}
+
 std::unique_ptr<IWorkload> NeonWorkloadFactory::CreateConstant(const ConstantQueueDescriptor& descriptor,
     const WorkloadInfo& info) const
 {
index dd8d9a2..60dbb90 100644 (file)
@@ -52,6 +52,7 @@ public:
     std::unique_ptr<IWorkload> CreateSplitter(const SplitterQueueDescriptor& descriptor,
                                               const WorkloadInfo& info) const override;
 
+    ARMNN_DEPRECATED_MSG("Use CreateConcat instead")
     std::unique_ptr<IWorkload> CreateMerger(const MergerQueueDescriptor& descriptor,
                                             const WorkloadInfo& info) const override;
 
@@ -97,6 +98,9 @@ public:
     std::unique_ptr<IWorkload> CreateL2Normalization(const L2NormalizationQueueDescriptor& descriptor,
                                                      const WorkloadInfo& info) const override;
 
+    std::unique_ptr<IWorkload> CreateConcat(const MergerQueueDescriptor& descriptor,
+                                            const WorkloadInfo& info) const override;
+
     std::unique_ptr<IWorkload> CreateConstant(const ConstantQueueDescriptor& descriptor,
                                               const WorkloadInfo& info) const override;
 
index 58618b4..48e411d 100644 (file)
@@ -304,9 +304,9 @@ ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test)
 ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest)
 ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test)
 
-// Merger
-ARMNN_AUTO_TEST_CASE(SimpleMerger, MergerTest)
-ARMNN_AUTO_TEST_CASE(MergerUint8, MergerUint8Test)
+// Concat
+ARMNN_AUTO_TEST_CASE(SimpleConcat, ConcatTest)
+ARMNN_AUTO_TEST_CASE(ConcatUint8, ConcatUint8Test)
 
 // Fully Connected
 ARMNN_AUTO_TEST_CASE(SimpleFullyConnected, FullyConnectedFloat32Test, false, false)
index 45c43a9..6544856 100644 (file)
@@ -135,11 +135,7 @@ std::unique_ptr<IWorkload> RefWorkloadFactory::CreateSplitter(const SplitterQueu
 std::unique_ptr<armnn::IWorkload> RefWorkloadFactory::CreateMerger(const MergerQueueDescriptor& descriptor,
                                                                    const WorkloadInfo&          info) const
 {
-    if (IsFloat16(info))
-    {
-        return MakeWorkload<NullWorkload, NullWorkload>(descriptor, info);
-    }
-    return std::make_unique<RefConcatWorkload>(descriptor, info);
+    return CreateConcat(descriptor, info);
 }
 
 std::unique_ptr<armnn::IWorkload> RefWorkloadFactory::CreateFullyConnected(
@@ -250,6 +246,16 @@ std::unique_ptr<IWorkload> RefWorkloadFactory::CreateL2Normalization(const L2Nor
     return MakeWorkload<RefL2NormalizationFloat32Workload, NullWorkload>(descriptor, info);
 }
 
+std::unique_ptr<armnn::IWorkload> RefWorkloadFactory::CreateConcat(const MergerQueueDescriptor& descriptor,
+                                                                   const WorkloadInfo&          info) const
+{
+    if (IsFloat16(info))
+    {
+        return MakeWorkload<NullWorkload, NullWorkload>(descriptor, info);
+    }
+    return std::make_unique<RefConcatWorkload>(descriptor, info);
+}
+
 std::unique_ptr<IWorkload> RefWorkloadFactory::CreateConstant(const ConstantQueueDescriptor& descriptor,
     const WorkloadInfo& info) const
 {
index cbfcbfa..985b634 100644 (file)
@@ -69,6 +69,7 @@ public:
     std::unique_ptr<IWorkload> CreateSplitter(const SplitterQueueDescriptor& descriptor,
                                               const WorkloadInfo& info) const override;
 
+    ARMNN_DEPRECATED_MSG("Use CreateConcat instead")
     std::unique_ptr<IWorkload> CreateMerger(const MergerQueueDescriptor& descriptor,
                                             const WorkloadInfo& info) const override;
 
@@ -114,6 +115,9 @@ public:
     std::unique_ptr<IWorkload> CreateL2Normalization(const L2NormalizationQueueDescriptor& descriptor,
                                                      const WorkloadInfo& info) const override;
 
+    std::unique_ptr<IWorkload> CreateConcat(const MergerQueueDescriptor& descriptor,
+                                            const WorkloadInfo& info) const override;
+
     std::unique_ptr<IWorkload> CreateConstant(const ConstantQueueDescriptor& descriptor,
                                               const WorkloadInfo& info) const override;
 
index 55a2516..62e05a9 100644 (file)
@@ -242,11 +242,11 @@ ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test)
 ARMNN_AUTO_TEST_CASE(CopyViaSplitter, CopyViaSplitterTest)
 ARMNN_AUTO_TEST_CASE(CopyViaSplitterUint8, CopyViaSplitterUint8Test)
 
-// Merger
-ARMNN_AUTO_TEST_CASE(SimpleMerger, MergerTest)
-ARMNN_AUTO_TEST_CASE(MergerUint8, MergerUint8Test)
-ARMNN_AUTO_TEST_CASE(MergerUint8DifferentQParams, MergerUint8DifferentQParamsTest)
-ARMNN_AUTO_TEST_CASE(MergerUint16, MergerUint16Test)
+// Concat
+ARMNN_AUTO_TEST_CASE(SimpleConcat, ConcatTest)
+ARMNN_AUTO_TEST_CASE(ConcatUint8, ConcatUint8Test)
+ARMNN_AUTO_TEST_CASE(ConcatUint8DifferentQParams, ConcatUint8DifferentQParamsTest)
+ARMNN_AUTO_TEST_CASE(ConcatUint16, ConcatUint16Test)
 
 // Add
 ARMNN_AUTO_TEST_CASE(SimpleAdd, AdditionTest)