IVGCVSW-1951 Remove type templating from ClPermuteWorkload
authorNattapat Chaimanowong <nattapat.chaimanowong@arm.com>
Wed, 10 Oct 2018 14:47:15 +0000 (15:47 +0100)
committerMatthew Bentham <matthew.bentham@arm.com>
Mon, 22 Oct 2018 15:57:53 +0000 (16:57 +0100)
Change-Id: Ibd12e04abe71015f31ee36a7f0a2416cb625cdad

src/backends/cl/ClWorkloadFactory.cpp
src/backends/cl/workloads/ClPermuteWorkload.cpp
src/backends/cl/workloads/ClPermuteWorkload.hpp

index b5b863b..6315b5a 100644 (file)
@@ -132,7 +132,7 @@ std::unique_ptr<armnn::IWorkload> ClWorkloadFactory::CreateFullyConnected(
 std::unique_ptr<armnn::IWorkload> ClWorkloadFactory::CreatePermute(const PermuteQueueDescriptor& descriptor,
                                                                    const WorkloadInfo&           info) const
 {
-    return MakeWorkload<ClPermuteFloatWorkload, ClPermuteUint8Workload>(descriptor, info);
+    return std::make_unique<ClPermuteWorkload>(descriptor, info);
 }
 
 std::unique_ptr<armnn::IWorkload> ClWorkloadFactory::CreatePooling2d(const Pooling2dQueueDescriptor& descriptor,
index 079772d..5dacc83 100644 (file)
@@ -26,10 +26,9 @@ arm_compute::Status ClPermuteWorkloadValidate(const PermuteDescriptor& descripto
     return arm_compute::Status{};
 }
 
-template <armnn::DataType... DataTypes>
-ClPermuteWorkload<DataTypes...>::ClPermuteWorkload(const PermuteQueueDescriptor& descriptor,
-                                               const WorkloadInfo& info)
-    : TypedWorkload<PermuteQueueDescriptor, DataTypes...>(descriptor, info)
+ClPermuteWorkload::ClPermuteWorkload(const PermuteQueueDescriptor& descriptor,
+                                     const WorkloadInfo& info)
+    : BaseWorkload<PermuteQueueDescriptor>(descriptor, info)
 {
     using armcomputetensorutils::BuildArmComputePermutationVector;
 
@@ -43,14 +42,10 @@ ClPermuteWorkload<DataTypes...>::ClPermuteWorkload(const PermuteQueueDescriptor&
     m_PermuteFunction.configure(&input, &output, BuildArmComputePermutationVector(mappings));
 }
 
-template <armnn::DataType... DataTypes>
-void ClPermuteWorkload<DataTypes...>::Execute() const
+void ClPermuteWorkload::Execute() const
 {
     ARMNN_SCOPED_PROFILING_EVENT_CL( GetName() + "_Execute");
     m_PermuteFunction.run();
 }
 
-template class ClPermuteWorkload<DataType::Float16, DataType::Float32>;
-template class ClPermuteWorkload<DataType::QuantisedAsymm8>;
-
 } // namespace armnn
index 8ff5707..43de302 100644 (file)
@@ -18,8 +18,7 @@ namespace armnn
 
 arm_compute::Status ClPermuteWorkloadValidate(const PermuteDescriptor& descriptor);
 
-template<armnn::DataType... DataTypes>
-class ClPermuteWorkload : public TypedWorkload<PermuteQueueDescriptor, DataTypes...>
+class ClPermuteWorkload : public BaseWorkload<PermuteQueueDescriptor>
 {
 public:
     static const std::string& GetName()
@@ -32,11 +31,8 @@ public:
     void Execute() const override;
 
 private:
-    using TypedWorkload<PermuteQueueDescriptor, DataTypes...>::m_Data;
+    using BaseWorkload<PermuteQueueDescriptor>::m_Data;
     mutable arm_compute::CLPermute m_PermuteFunction;
 };
 
-using ClPermuteFloatWorkload = ClPermuteWorkload<DataType::Float16, DataType::Float32>;
-using ClPermuteUint8Workload = ClPermuteWorkload<DataType::QuantisedAsymm8>;
-
 } // namespace armnn