Compute Library
 21.02
NEElementwiseComparisonStatic< op > Class Template Reference

Basic function to run cpu::kernels::CpuComparisonKernel. More...

#include <NEElementwiseOperations.h>

Collaboration diagram for NEElementwiseComparisonStatic< op >:
[legend]

Public Member Functions

 NEElementwiseComparisonStatic ()
 Default Constructor. More...
 
 ~NEElementwiseComparisonStatic ()
 Default Destructor. More...
 
 NEElementwiseComparisonStatic (const NEElementwiseComparisonStatic &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEElementwiseComparisonStatic (NEElementwiseComparisonStatic &&)
 Default move constructor. More...
 
NEElementwiseComparisonStaticoperator= (const NEElementwiseComparisonStatic &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEElementwiseComparisonStaticoperator= (NEElementwiseComparisonStatic &&)
 Default move assignment operator. More...
 
void configure (ITensor *input1, ITensor *input2, ITensor *output)
 Initialise the kernel's inputs, output and conversion policy. More...
 
void run () override
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Static Public Member Functions

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::CpuComparisonKernel. More...
 

Detailed Description

template<ComparisonOperation op>
class arm_compute::NEElementwiseComparisonStatic< op >

Basic function to run cpu::kernels::CpuComparisonKernel.

Note
The tensor data type for the inputs must be U8/QASYMM8/QASYMM8_SIGNED/S16/F16/S32/F32.
The function performs a comparison operation between two tensors.

Definition at line 324 of file NEElementwiseOperations.h.

Constructor & Destructor Documentation

◆ NEElementwiseComparisonStatic() [1/3]

Default Constructor.

Definition at line 249 of file NEElementwiseOperations.cpp.

References NEElementwiseComparisonStatic< op >::operator=(), and NEElementwiseComparisonStatic< op >::~NEElementwiseComparisonStatic().

250  : _impl(std::make_unique<Impl>())
251 {
252 }

◆ ~NEElementwiseComparisonStatic()

◆ NEElementwiseComparisonStatic() [2/3]

Prevent instances of this class from being copied (As this class contains pointers)

◆ NEElementwiseComparisonStatic() [3/3]

Default move constructor.

Member Function Documentation

◆ configure()

void configure ( ITensor input1,
ITensor input2,
ITensor output 
)

Initialise the kernel's inputs, output and conversion policy.

Parameters
[in,out]input1First tensor input. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/F16/S32/F32.
[in,out]input2Second tensor input. Data types supported: Same as input1.
[out]outputOutput tensor. Data types supported: U16/U32.

Definition at line 261 of file NEElementwiseOperations.cpp.

References ITensor::info().

262 {
263  _impl->src_0 = input1;
264  _impl->src_1 = input2;
265  _impl->dst = output;
266  _impl->op = std::make_unique<cpu::CpuElementwiseComparisonStatic<COP>>();
267  _impl->op->configure(input1->info(), input2->info(), output->info());
268 }

◆ operator=() [1/2]

NEElementwiseComparisonStatic& operator= ( const NEElementwiseComparisonStatic< op > &  )
delete

Prevent instances of this class from being copied (As this class contains pointers)

Referenced by NEElementwiseComparisonStatic< op >::NEElementwiseComparisonStatic().

◆ operator=() [2/2]

NEElementwiseComparisonStatic< COP > & operator= ( NEElementwiseComparisonStatic< op > &&  )
default

Default move assignment operator.

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For Neon kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implements IFunction.

Definition at line 277 of file NEElementwiseOperations.cpp.

References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, ITensorPack::add_tensor(), and arm_compute::test::validation::dst.

278 {
279  ITensorPack pack;
280  pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
281  pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
282  pack.add_tensor(TensorType::ACL_DST, _impl->dst);
283  _impl->op->run(pack);
284 }

◆ validate()

Status validate ( const ITensorInfo input1,
const ITensorInfo input2,
const ITensorInfo output 
)
static

Static function to check if given info will lead to a valid configuration of cpu::kernels::CpuComparisonKernel.

Parameters
[in]input1First tensor input info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/F16/S32/F32.
[in]input2Second tensor input info. Data types supported: Same as input1.
[in]outputOutput tensor info. Data types supported: U16/U32.
Returns
a status

Definition at line 271 of file NEElementwiseOperations.cpp.

References CpuElementwiseComparisonStatic< op >::validate().

272 {
273  return cpu::CpuElementwiseComparisonStatic<COP>::validate(input1, input2, output);
274 }
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...

The documentation for this class was generated from the following files: