34 struct NEElementwiseMax::Impl
36 const ITensor *src_0{
nullptr };
37 const ITensor *src_1{
nullptr };
38 ITensor *
dst{
nullptr };
39 std::unique_ptr<cpu::CpuElementwiseMax> op{
nullptr };
43 : _impl(
std::make_unique<Impl>())
53 _impl->src_0 = input1;
54 _impl->src_1 = input2;
56 _impl->op = std::make_unique<cpu::CpuElementwiseMax>();
57 _impl->op->configure(input1->
info(), input2->
info(), output->
info());
75 struct NEElementwiseMin::Impl
77 const ITensor *src_0{
nullptr };
78 const ITensor *src_1{
nullptr };
80 std::unique_ptr<cpu::CpuElementwiseMin> op{
nullptr };
84 : _impl(
std::make_unique<Impl>())
94 _impl->src_0 = input1;
95 _impl->src_1 = input2;
97 _impl->op = std::make_unique<cpu::CpuElementwiseMin>();
98 _impl->op->configure(input1->
info(), input2->
info(), output->
info());
113 _impl->op->run(pack);
116 struct NEElementwiseSquaredDiff::Impl
118 const ITensor *src_0{
nullptr };
119 const ITensor *src_1{
nullptr };
121 std::unique_ptr<cpu::CpuElementwiseSquaredDiff> op{
nullptr };
125 : _impl(
std::make_unique<Impl>())
135 _impl->src_0 = input1;
136 _impl->src_1 = input2;
138 _impl->op = std::make_unique<cpu::CpuElementwiseSquaredDiff>();
139 _impl->op->configure(input1->
info(), input2->
info(), output->
info());
154 _impl->op->run(pack);
157 struct NEElementwiseDivision::Impl
159 const ITensor *src_0{
nullptr };
160 const ITensor *src_1{
nullptr };
162 std::unique_ptr<cpu::CpuElementwiseDivision> op{
nullptr };
166 : _impl(
std::make_unique<Impl>())
176 _impl->src_0 = input1;
177 _impl->src_1 = input2;
179 _impl->op = std::make_unique<cpu::CpuElementwiseDivision>();
180 _impl->op->configure(input1->
info(), input2->
info(), output->
info());
195 _impl->op->run(pack);
198 struct NEElementwisePower::Impl
200 const ITensor *src_0{
nullptr };
201 const ITensor *src_1{
nullptr };
203 std::unique_ptr<cpu::CpuElementwisePower> op{
nullptr };
207 : _impl(
std::make_unique<Impl>())
217 _impl->src_0 = input1;
218 _impl->src_1 = input2;
220 _impl->op = std::make_unique<cpu::CpuElementwisePower>();
221 _impl->op->configure(input1->
info(), input2->
info(), output->
info());
236 _impl->op->run(pack);
239 template <ComparisonOperation COP>
242 const ITensor *src_0{
nullptr };
243 const ITensor *src_1{
nullptr };
245 std::unique_ptr<cpu::CpuElementwiseComparisonStatic<COP>> op{
nullptr };
248 template <ComparisonOperation COP>
250 : _impl(
std::make_unique<Impl>())
253 template <ComparisonOperation COP>
255 template <ComparisonOperation COP>
257 template <ComparisonOperation COP>
260 template <ComparisonOperation COP>
263 _impl->src_0 = input1;
264 _impl->src_1 = input2;
266 _impl->op = std::make_unique<cpu::CpuElementwiseComparisonStatic<COP>>();
267 _impl->op->configure(input1->
info(), input2->
info(), output->
info());
270 template <ComparisonOperation COP>
276 template <ComparisonOperation COP>
283 _impl->op->run(pack);
286 struct NEElementwiseComparison::Impl
288 const ITensor *src_0{
nullptr };
289 const ITensor *src_1{
nullptr };
291 std::unique_ptr<cpu::CpuElementwiseComparison> op{
nullptr };
295 : _impl(
std::make_unique<Impl>())
304 _impl->src_0 = input1;
305 _impl->src_1 = input2;
307 _impl->op = std::make_unique<cpu::CpuElementwiseComparison>();
308 _impl->op->configure(input1->
info(), input2->
info(), output->
info(), op);
322 _impl->op->run(pack);
void configure(ITensor *input1, ITensor *input2, ITensor *output, ComparisonOperation op)
Initialise the kernel's inputs, output and conversion policy.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuCompari...
void configure(ITensor *input1, ITensor *input2, ITensor *output)
Initialise the kernel's inputs, output and conversion policy.
NEElementwiseSquaredDiff & operator=(const NEElementwiseSquaredDiff &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
bool enabled() const
Check if initialised.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ComparisonOperation op)
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuCompari...
NEElementwiseMin()
Default Constructor.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
NEElementwiseComparisonStatic()
Default Constructor.
NEElementwiseMin & operator=(const NEElementwiseMin &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
Basic function to run cpu::kernels::CpuArithmeticKernel for min.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
Basic function to run cpu::kernels::CpuArithmeticKernel for power.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
Store the tensor's metadata.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuCompari...
Basic function to run cpu::kernels::CpuComparisonKernel.
Basic function to run cpu::kernels::CpuArithmeticKernel for max.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
Activation Layer Information class.
Interface for Neon tensor.
Copyright (c) 2017-2021 Arm Limited.
NEElementwiseComparison()
Default Constructor.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
void run() override
Run the kernels contained in the function.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
~NEElementwiseComparisonStatic()
Default Destructor.
void configure(ITensor *input1, ITensor *input2, ITensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
~NEElementwiseMax()
Default Destructor.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
void run() override
Run the kernels contained in the function.
Basic function to run cpu::kernels::CpuArithmeticKernel for division.
~NEElementwiseDivision()
Default Destructor.
void configure(ITensor *input1, ITensor *input2, ITensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
void run() override
Run the kernels contained in the function.
~NEElementwisePower()
Default Destructor.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
ComparisonOperation
Supported comparison operations.
Basic function to run cpu::kernels::CpuArithmeticKernel for squared difference.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
NEElementwiseMax()
Default Constructor.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
NEElementwisePower & operator=(const NEElementwisePower &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
~NEElementwiseSquaredDiff()
Default Destructor.
void run() override
Run the kernels contained in the function.
Basic function to run cpu::kernels::CpuComparisonKernel.
NEElementwiseComparison & operator=(const NEElementwiseComparison &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
void run() override
Run the kernels contained in the function.
void run() override
Run the kernels contained in the function.
NEElementwiseSquaredDiff()
Default Constructor.
~NEElementwiseMin()
Default Destructor.
~NEElementwiseComparison()
Default Destructor.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ComparisonOperation op)
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuCompari...
void configure(ITensor *input1, ITensor *input2, ITensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
NEElementwisePower()
Default Constructor.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuArithme...
void configure(ITensor *input1, ITensor *input2, ITensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
NEElementwiseMax & operator=(const NEElementwiseMax &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
NEElementwiseDivision()
Default Constructor.
void run() override
Run the kernels contained in the function.
NEElementwiseDivision & operator=(const NEElementwiseDivision &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
void configure(ITensor *input1, ITensor *input2, ITensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
NEElementwiseComparisonStatic & operator=(const NEElementwiseComparisonStatic &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
void add_tensor(int id, ITensor *tensor)
Add tensor to the pack.