Just include the function definition that is specifically needed for each workload.
Also, tighten up the scope where Compute Library functions are available.
Knocks about 30seconds off a 4m30s single-threaded compile of the Neon workloads.
Change-Id: Idac438f3bc77ff978295fbc9505cb42447def145
//
#include "NeonActivationWorkload.hpp"
+#include "NeonWorkloadUtils.hpp"
#include <aclCommon/ArmComputeUtils.hpp>
+#include <arm_compute/runtime/NEON/functions/NEActivationLayer.h>
+
namespace armnn
{
arm_compute::ITensor& input = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
arm_compute::ITensor& output = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
- m_ActivationLayer.configure(&input, &output, activationLayerInfo);
+ auto layer = std::make_unique<arm_compute::NEActivationLayer>();
+ layer->configure(&input, &output, activationLayerInfo);
+
+ m_ActivationLayer.reset(layer.release());
}
void NeonActivationWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonActivationWorkload_Execute");
- m_ActivationLayer.run();
+ m_ActivationLayer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/core/Error.h>
+#include <arm_compute/runtime/IFunction.h>
namespace armnn
{
void Execute() const override;
private:
- mutable arm_compute::NEActivationLayer m_ActivationLayer;
+ std::unique_ptr<arm_compute::IFunction> m_ActivationLayer;
};
} //namespace armnn
//
#include "NeonAdditionWorkload.hpp"
+#include "NeonWorkloadUtils.hpp"
+
#include <aclCommon/ArmComputeTensorUtils.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
+#include <arm_compute/runtime/NEON/functions/NEArithmeticAddition.h>
+
namespace armnn
{
arm_compute::ITensor& input2 = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
arm_compute::ITensor& output = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
- m_AddLayer.configure(&input1, &input2, &output, arm_compute::ConvertPolicy::SATURATE);
+ auto layer = std::make_unique<arm_compute::NEArithmeticAddition>();
+ layer->configure(&input1, &input2, &output, arm_compute::ConvertPolicy::SATURATE);
+ m_AddLayer.reset(layer.release());
}
void NeonAdditionWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonAdditionWorkload_Execute");
- m_AddLayer.run();
+ m_AddLayer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/core/Error.h>
+#include <arm_compute/runtime/IFunction.h>
namespace armnn
{
virtual void Execute() const override;
private:
- mutable arm_compute::NEArithmeticAddition m_AddLayer;
+ std::unique_ptr<arm_compute::IFunction> m_AddLayer;
};
} //namespace armnn
//
#include "NeonBatchNormalizationWorkload.hpp"
+
+#include "NeonWorkloadUtils.hpp"
+
#include <backendsCommon/CpuTensorHandle.hpp>
#include <aclCommon/ArmComputeTensorUtils.hpp>
-#include <armnn/ArmNN.hpp>
+
+#include <arm_compute/runtime/NEON/functions/NEBatchNormalizationLayer.h>
namespace armnn
{
m_Beta = std::make_unique<arm_compute::Tensor>();
BuildArmComputeTensor(*m_Beta, m_Data.m_Beta->GetTensorInfo());
- m_Layer.configure(&input,
- &output,
- m_Mean.get(),
- m_Variance.get(),
- m_Beta.get(),
- m_Gamma.get(),
- m_Data.m_Parameters.m_Eps);
+ auto layer = std::make_unique<arm_compute::NEBatchNormalizationLayer>();
+ layer->configure(&input,
+ &output,
+ m_Mean.get(),
+ m_Variance.get(),
+ m_Beta.get(),
+ m_Gamma.get(),
+ m_Data.m_Parameters.m_Eps);
+ m_Layer.reset(layer.release());
InitializeArmComputeTensorData(*m_Mean, m_Data.m_Mean);
InitializeArmComputeTensorData(*m_Variance, m_Data.m_Variance);
// Force Compute Library to perform the necessary copying and reshaping, after which
// delete all the input tensors that will no longer be needed
- m_Layer.prepare();
+ m_Layer->prepare();
FreeUnusedTensors();
}
void NeonBatchNormalizationWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonBatchNormalizationWorkload_Execute");
- m_Layer.run();
+ m_Layer->run();
}
void NeonBatchNormalizationWorkload::FreeUnusedTensors()
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/runtime/IFunction.h>
+#include <arm_compute/runtime/Tensor.h>
+
+#include <memory>
namespace armnn
{
virtual void Execute() const override;
private:
- mutable arm_compute::NEBatchNormalizationLayer m_Layer;
+ std::unique_ptr<arm_compute::IFunction> m_Layer;
std::unique_ptr<arm_compute::Tensor> m_Mean;
std::unique_ptr<arm_compute::Tensor> m_Variance;
#include <backendsCommon/CpuTensorHandle.hpp>
#include <aclCommon/ArmComputeTensorUtils.hpp>
-#include <neon/NeonLayerSupport.hpp>
+#include <neon/workloads/NeonWorkloadUtils.hpp>
+
+#include <arm_compute/runtime/NEON/functions/NEConvolutionLayer.h>
#include <armnn/Types.hpp>
#include <Half.hpp>
#pragma once
-#include <aclCommon/ArmComputeTensorUtils.hpp>
-#include <backendsCommon/CpuTensorHandle.hpp>
-#include <neon/NeonLayerSupport.hpp>
-#include <neon/workloads/NeonWorkloadUtils.hpp>
#include <backendsCommon/Workload.hpp>
+#include <arm_compute/runtime/IFunction.h>
+#include <arm_compute/runtime/Tensor.h>
#include <arm_compute/runtime/MemoryManagerOnDemand.h>
#include <memory>
#include "NeonDepthwiseConvolutionWorkload.hpp"
+#include "NeonWorkloadUtils.hpp"
+
+#include <DataLayoutIndexed.hpp>
#include <aclCommon/ArmComputeTensorUtils.hpp>
#include <neon/NeonLayerSupport.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
#include <backendsCommon/WorkloadUtils.hpp>
+#include <arm_compute/runtime/NEON/functions/NEDepthwiseConvolutionLayer.h>
+
+using namespace armnnUtils;
+
namespace armnn
{
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/runtime/IFunction.h>
+#include <arm_compute/runtime/Tensor.h>
+
+#include <memory>
namespace armnn
{
#include "NeonFloorFloatWorkload.hpp"
+#include "NeonWorkloadUtils.hpp"
+
+#include <arm_compute/runtime/NEON/functions/NEFloor.h>
+
+#include <boost/polymorphic_cast.hpp>
+
namespace armnn
{
NeonFloorFloatWorkload::NeonFloorFloatWorkload(const FloorQueueDescriptor& descriptor,
arm_compute::ITensor& input = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
arm_compute::ITensor& output = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
- m_Layer.configure(&input, &output);
+ auto layer = std::make_unique<arm_compute::NEFloor>();
+ layer->configure(&input, &output);
+ m_Layer.reset(layer.release());
}
void NeonFloorFloatWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonFloorFloatWorkload_Execute");
- m_Layer.run();
+ m_Layer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/runtime/IFunction.h>
+#include <arm_compute/runtime/Tensor.h>
+
+#include <memory>
namespace armnn
{
virtual void Execute() const override;
private:
- mutable arm_compute::NEFloor m_Layer;
+ std::unique_ptr<arm_compute::IFunction> m_Layer;
};
} //namespace armnn
#include "NeonFullyConnectedWorkload.hpp"
+#include "NeonWorkloadUtils.hpp"
#include <aclCommon/ArmComputeTensorUtils.hpp>
#include <aclCommon/ArmComputeUtils.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
+#include <arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h>
+
namespace armnn
{
using namespace armcomputetensorutils;
NeonFullyConnectedWorkload::NeonFullyConnectedWorkload(const FullyConnectedQueueDescriptor& descriptor,
const WorkloadInfo& info, std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager)
: BaseWorkload<FullyConnectedQueueDescriptor>(descriptor, info)
- , m_FullyConnectedLayer(memoryManager)
{
m_Data.ValidateInputsOutputs("NeonFullyConnectedWorkload", 1, 1);
// Construct
arm_compute::FullyConnectedLayerInfo fc_info;
fc_info.transpose_weights = m_Data.m_Parameters.m_TransposeWeightMatrix;
- m_FullyConnectedLayer.configure(&input, m_WeightsTensor.get(), m_BiasesTensor.get(), &output, fc_info);
+
+ auto layer = std::make_unique<arm_compute::NEFullyConnectedLayer>(memoryManager);
+ layer->configure(&input, m_WeightsTensor.get(), m_BiasesTensor.get(), &output, fc_info);
+ m_FullyConnectedLayer.reset(layer.release());
// Allocate
if (m_Data.m_Weight->GetTensorInfo().GetDataType() == DataType::QuantisedAsymm8)
// Force Compute Library to perform the necessary copying and reshaping, after which
// delete all the input tensors that will no longer be needed
- m_FullyConnectedLayer.prepare();
+ m_FullyConnectedLayer->prepare();
FreeUnusedTensors();
}
void NeonFullyConnectedWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonFullyConnectedWorkload_Execute");
- m_FullyConnectedLayer.run();
+ m_FullyConnectedLayer->run();
}
void NeonFullyConnectedWorkload::FreeUnusedTensors()
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+#include <arm_compute/core/Error.h>
+#include <arm_compute/runtime/IFunction.h>
#include <arm_compute/runtime/MemoryManagerOnDemand.h>
+#include <arm_compute/runtime/Tensor.h>
#include <memory>
virtual void Execute() const override;
private:
- mutable arm_compute::NEFullyConnectedLayer m_FullyConnectedLayer;
+ std::unique_ptr<arm_compute::IFunction> m_FullyConnectedLayer;
std::unique_ptr<arm_compute::Tensor> m_WeightsTensor;
std::unique_ptr<arm_compute::Tensor> m_BiasesTensor;
//
#include "NeonL2NormalizationFloatWorkload.hpp"
+
+#include "NeonWorkloadUtils.hpp"
+
#include <aclCommon/ArmComputeUtils.hpp>
+#include <arm_compute/runtime/NEON/functions/NEL2NormalizeLayer.h>
+
namespace armnn
{
using namespace armcomputetensorutils;
NeonL2NormalizationFloatWorkload::NeonL2NormalizationFloatWorkload(const L2NormalizationQueueDescriptor& descriptor,
const WorkloadInfo& info, std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager)
: FloatWorkload<L2NormalizationQueueDescriptor>(descriptor, info)
- , m_Layer(memoryManager)
{
m_Data.ValidateInputsOutputs("NeonL2NormalizationFloatWorkload", 1, 1);
unsigned int axis = (m_Data.m_Parameters.m_DataLayout == DataLayout::NCHW) ? 2 : 0;
- m_Layer.configure(&input, &output, axis);
+ auto layer = std::make_unique<arm_compute::NEL2NormalizeLayer>(memoryManager);
+ layer->configure(&input, &output, axis);
+ m_Layer.reset(layer.release());
}
void NeonL2NormalizationFloatWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonL2NormalizationFloatWorkload_Execute");
- m_Layer.run();
+ m_Layer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/core/Error.h>
+#include <arm_compute/runtime/IFunction.h>
#include <arm_compute/runtime/MemoryManagerOnDemand.h>
#include <memory>
virtual void Execute() const override;
private:
- mutable arm_compute::NEL2NormalizeLayer m_Layer;
+ std::unique_ptr<arm_compute::IFunction> m_Layer;
};
} //namespace armnn
//
#include "NeonMergerWorkload.hpp"
-#include <armnn/ArmNN.hpp>
+
+#include "NeonWorkloadUtils.hpp"
+
#include <aclCommon/ArmComputeTensorUtils.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
#include <neon/NeonTensorHandle.hpp>
+#include <arm_compute/runtime/NEON/functions/NEConcatenateLayer.h>
namespace armnn
{
arm_compute::DataLayoutDimension aclAxis = arm_compute::DataLayoutDimension::WIDTH;
- m_Layer.configure(aclInputs, &output, aclAxis);
+ auto layer = std::make_unique<arm_compute::NEConcatenateLayer>();
+ layer->configure(aclInputs, &output, aclAxis);
+ m_Layer.reset(layer.release());
- m_Layer.prepare();
+ m_Layer->prepare();
}
void NeonMergerWorkload::Execute() const
if (m_Execute)
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonMergerWorkload_Execute");
- m_Layer.run();
+ m_Layer->run();
}
}
#pragma once
#include <backendsCommon/Workload.hpp>
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+
+#include <arm_compute/core/Error.h>
+#include <arm_compute/runtime/IFunction.h>
+#
+#include <memory>
namespace armnn
{
void Execute() const override;
private:
- mutable arm_compute::NEConcatenateLayer m_Layer;
+ std::unique_ptr<arm_compute::IFunction> m_Layer;
bool m_Execute;
};
#include "NeonMultiplicationFloatWorkload.hpp"
+#include "NeonWorkloadUtils.hpp"
+
+#include <arm_compute/runtime/NEON/functions/NEPixelWiseMultiplication.h>
namespace armnn
{
// At the time of writing, configure() will fail if a rounding policy other than TO_ZERO is supplied to it,
// when providing a scale of 1.0 for F32 tensors, even though the provided rounding policy appears to be
// ignored for F32 tensors.
- m_PixelWiseMultiplication.configure(&input1,
- &input2,
- &output,
- 1.0f,
- arm_compute::ConvertPolicy::SATURATE,
- arm_compute::RoundingPolicy::TO_ZERO);
+ auto layer = std::make_unique<arm_compute::NEPixelWiseMultiplication>();
+ layer->configure(&input1,
+ &input2,
+ &output,
+ 1.0f,
+ arm_compute::ConvertPolicy::SATURATE,
+ arm_compute::RoundingPolicy::TO_ZERO);
+ m_PixelWiseMultiplication.reset(layer.release());
}
void NeonMultiplicationFloatWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonMultiplicationFloatWorkload_Execute");
- m_PixelWiseMultiplication.run();
+ m_PixelWiseMultiplication->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/core/Error.h>
+#include <arm_compute/runtime/IFunction.h>
+
+#include <memory>
namespace armnn
{
virtual void Execute() const override;
private:
- mutable arm_compute::NEPixelWiseMultiplication m_PixelWiseMultiplication;
+ std::unique_ptr<arm_compute::IFunction> m_PixelWiseMultiplication;
};
} //namespace armnn
//
#include "NeonNormalizationFloatWorkload.hpp"
-#include <neon/NeonLayerSupport.hpp>
+
+#include "NeonWorkloadUtils.hpp"
#include <aclCommon/ArmComputeUtils.hpp>
#include <aclCommon/ArmComputeTensorUtils.hpp>
+#include <arm_compute/runtime/NEON/functions/NENormalizationLayer.h>
+
using namespace armnn::armcomputetensorutils;
namespace armnn
const WorkloadInfo& info,
std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager)
: FloatWorkload<NormalizationQueueDescriptor>(descriptor, info)
- , m_NormalizationLayer(memoryManager)
{
m_Data.ValidateInputsOutputs("NeonNormalizationFloatWorkload", 1, 1);
std::string reasonIfUnsupported;
m_Data.m_Parameters.m_Beta,
m_Data.m_Parameters.m_K,
false);
-
- m_NormalizationLayer.configure(&input, &output, normalizationInfo);
+ auto layer = std::make_unique<arm_compute::NENormalizationLayer>(memoryManager);
+ layer->configure(&input, &output, normalizationInfo);
+ m_NormalizationLayer.reset(layer.release());
}
void NeonNormalizationFloatWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonNormalizationFloatWorkload_Execute");
- m_NormalizationLayer.run();
+ m_NormalizationLayer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/core/Error.h>
+#include <arm_compute/runtime/IFunction.h>
#include <arm_compute/runtime/MemoryManagerOnDemand.h>
+#include <memory>
+
namespace armnn
{
virtual void Execute() const override;
private:
- mutable arm_compute::NENormalizationLayer m_NormalizationLayer;
+ std::unique_ptr<arm_compute::IFunction> m_NormalizationLayer;
};
} //namespace armnn
//
#include "NeonPooling2dWorkload.hpp"
-#include <neon/NeonLayerSupport.hpp>
+
+#include "NeonWorkloadUtils.hpp"
+
#include <neon/NeonTensorHandle.hpp>
#include <aclCommon/ArmComputeUtils.hpp>
#include <aclCommon/ArmComputeTensorUtils.hpp>
+#include <arm_compute/runtime/NEON/functions/NEPoolingLayer.h>
+
namespace armnn
{
using namespace armcomputetensorutils;
arm_compute::PoolingLayerInfo layerInfo = BuildArmComputePoolingLayerInfo(m_Data.m_Parameters);
- m_PoolingLayer.configure(&input, &output, layerInfo);
+ auto layer = std::make_unique<arm_compute::NEPoolingLayer>();
+ layer->configure(&input, &output, layerInfo);
+ m_PoolingLayer.reset(layer.release());
}
void NeonPooling2dWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonPooling2dWorkload_Execute");
- m_PoolingLayer.run();
+ m_PoolingLayer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/core/Error.h>
+#include <arm_compute/runtime/IFunction.h>
+
+#include <memory>
namespace armnn
{
void Execute() const override;
private:
- mutable arm_compute::NEPoolingLayer m_PoolingLayer;
+ std::unique_ptr<arm_compute::IFunction> m_PoolingLayer;
};
} //namespace armnn
#include "NeonReshapeWorkload.hpp"
+#include "NeonWorkloadUtils.hpp"
+
+#include <arm_compute/runtime/NEON/functions/NEReshapeLayer.h>
+
+#include <boost/polymorphic_cast.hpp>
+
namespace armnn
{
arm_compute::ITensor& input = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
arm_compute::ITensor& output = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
- m_Layer.configure(&input, &output);
+ auto layer = std::make_unique<arm_compute::NEReshapeLayer>();
+ layer->configure(&input, &output);
+ m_Layer.reset(layer.release());
}
void NeonReshapeWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonReshapeWorkload_Execute");
- m_Layer.run();
+ m_Layer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/runtime/IFunction.h>
+
+#include <memory>
namespace armnn
{
virtual void Execute() const override;
private:
- mutable arm_compute::NEReshapeLayer m_Layer;
+ std::unique_ptr<arm_compute::IFunction> m_Layer;
};
} //namespace armnn
#include <aclCommon/ArmComputeTensorUtils.hpp>
+#include <arm_compute/runtime/NEON/functions/NESoftmaxLayer.h>
+
namespace armnn
{
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <armnn/Descriptors.hpp>
+#include <arm_compute/core/Error.h>
namespace armnn
{
#include "NeonSoftmaxFloatWorkload.hpp"
+#include "NeonWorkloadUtils.hpp"
+
+#include <arm_compute/runtime/NEON/functions/NESoftmaxLayer.h>
+
namespace armnn
{
NeonSoftmaxFloatWorkload::NeonSoftmaxFloatWorkload(const SoftmaxQueueDescriptor& descriptor,
const WorkloadInfo& info, std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager)
: FloatWorkload<SoftmaxQueueDescriptor>(descriptor, info)
- , m_SoftmaxLayer(memoryManager)
{
m_Data.ValidateInputsOutputs("NeonSoftmaxFloatWorkload", 1, 1);
arm_compute::ITensor& input = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
arm_compute::ITensor& output = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
- m_SoftmaxLayer.configure(&input, &output, m_Data.m_Parameters.m_Beta);
+ auto layer = std::make_unique<arm_compute::NESoftmaxLayer>(memoryManager);
+ layer->configure(&input, &output, m_Data.m_Parameters.m_Beta);
+ m_SoftmaxLayer.reset(layer.release());
}
void NeonSoftmaxFloatWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonSoftmaxFloatWorkload_Execute");
- m_SoftmaxLayer.run();
+ m_SoftmaxLayer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/runtime/IFunction.h>
#include <arm_compute/runtime/MemoryManagerOnDemand.h>
#include <memory>
virtual void Execute() const override;
private:
- mutable arm_compute::NESoftmaxLayer m_SoftmaxLayer;
+ std::unique_ptr<arm_compute::IFunction> m_SoftmaxLayer;
};
} //namespace armnn
#include "NeonSoftmaxUint8Workload.hpp"
+#include "NeonWorkloadUtils.hpp"
+
+#include <arm_compute/runtime/NEON/functions/NESoftmaxLayer.h>
+
namespace armnn
{
const WorkloadInfo& info,
std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager)
: Uint8Workload<SoftmaxQueueDescriptor>(descriptor, info)
- , m_SoftmaxLayer(memoryManager)
{
m_Data.ValidateInputsOutputs("NeonSoftmaxUint8Workload", 1, 1);
"Invalid quantization for output. Only scale = 1.0f / 256.0f and offset = 0 supported");
}
- m_SoftmaxLayer.configure(&input, &output, descriptor.m_Parameters.m_Beta);
+ auto layer = std::make_unique<arm_compute::NESoftmaxLayer>(memoryManager);
+ layer->configure(&input, &output, descriptor.m_Parameters.m_Beta);
+ m_SoftmaxLayer.reset(layer.release());
}
void NeonSoftmaxUint8Workload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonSoftmaxUint8Workload_Execute");
- m_SoftmaxLayer.run();
+ m_SoftmaxLayer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/runtime/IFunction.h>
#include <arm_compute/runtime/MemoryManagerOnDemand.h>
+#include <memory>
+
namespace armnn
{
virtual void Execute() const override;
private:
- mutable arm_compute::NESoftmaxLayer m_SoftmaxLayer;
+ std::unique_ptr<arm_compute::IFunction> m_SoftmaxLayer;
};
} //namespace armnn
//
#include "NeonSubtractionFloatWorkload.hpp"
+
+#include "NeonWorkloadUtils.hpp"
#include <aclCommon/ArmComputeTensorUtils.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
+#include <arm_compute/runtime/NEON/functions/NEArithmeticSubtraction.h>
+
namespace armnn
{
arm_compute::ITensor& input2 = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
arm_compute::ITensor& output = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
- m_SubLayer.configure(&input1, &input2, &output, arm_compute::ConvertPolicy::SATURATE);
+ auto layer = std::make_unique<arm_compute::NEArithmeticSubtraction>();
+ layer->configure(&input1, &input2, &output, arm_compute::ConvertPolicy::SATURATE);
+ m_SubLayer.reset(layer.release());
}
void NeonSubtractionFloatWorkload::Execute() const
{
ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonSubtractionFloatWorkload_Execute");
- m_SubLayer.run();
+ m_SubLayer->run();
}
} //namespace armnn
#pragma once
-#include <neon/workloads/NeonWorkloadUtils.hpp>
+#include <backendsCommon/Workload.hpp>
+
+#include <arm_compute/core/Error.h>
+#include <arm_compute/runtime/IFunction.h>
+
+#include <memory>
namespace armnn
{
virtual void Execute() const override;
private:
- mutable arm_compute::NEArithmeticSubtraction m_SubLayer;
+ std::unique_ptr<arm_compute::IFunction> m_SubLayer;
};
} //namespace armnn
#include <neon/NeonTensorHandle.hpp>
#include <neon/NeonTimer.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
-#include <arm_compute/runtime/NEON/NEFunctions.h>
#include <Half.hpp>