Compute Library
 19.08
NEComparisonOperationKernel Class Reference

#include <NEElementwiseOperationKernel.h>

Collaboration diagram for NEComparisonOperationKernel:
[legend]

Public Member Functions

 NEComparisonOperationKernel ()=default
 Default constructor. More...
 
void configure (ComparisonOperation op, const ITensor *input1, const ITensor *input2, ITensor *output)
 Static function to check if given info will lead to a valid configuration of NEComparisonOperationKernel. More...
 
- Public Member Functions inherited from NEElementwiseOperationKernel
const char * name () const override
 Name of the kernel. More...
 
 NEElementwiseOperationKernel ()
 Default constructor. More...
 
 NEElementwiseOperationKernel (const NEElementwiseOperationKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEElementwiseOperationKerneloperator= (const NEElementwiseOperationKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEElementwiseOperationKernel (NEElementwiseOperationKernel &&)=default
 Allow instances of this class to be moved. More...
 
NEElementwiseOperationKerneloperator= (NEElementwiseOperationKernel &&)=default
 Allow instances of this class to be moved. More...
 
 ~NEElementwiseOperationKernel ()=default
 Default destructor. More...
 
void run (const Window &window, const ThreadInfo &info) override
 Execute the kernel on the passed window. More...
 
- Public Member Functions inherited from ICPPKernel
virtual ~ICPPKernel ()=default
 Default destructor. More...
 
- Public Member Functions inherited from IKernel
 IKernel ()
 Constructor. More...
 
virtual ~IKernel ()=default
 Destructor. More...
 
virtual bool is_parallelisable () const
 Indicates whether or not the kernel is parallelisable. More...
 
virtual BorderSize border_size () const
 The size of the border for that kernel. More...
 
const Windowwindow () const
 The maximum window the kernel can be executed on. More...
 

Static Public Member Functions

static Status validate (ComparisonOperation op, const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output)
 Static function to check if given info will lead to a valid configuration of NEComparisonOperationKernel. More...
 

Additional Inherited Members

- Public Types inherited from NEElementwiseOperationKernel
using ElementwiseFunction = void(const ITensor *input1, const ITensor *input2, ITensor *output, const Window &window)
 Common signature for all the specialised arithmetic functions. More...
 

Detailed Description

Definition at line 183 of file NEElementwiseOperationKernel.h.

Constructor & Destructor Documentation

◆ NEComparisonOperationKernel()

Default constructor.

Member Function Documentation

◆ configure()

void configure ( ComparisonOperation  op,
const ITensor input1,
const ITensor input2,
ITensor output 
)

Static function to check if given info will lead to a valid configuration of NEComparisonOperationKernel.

Comparison operators (equal, not equal, less than, greater than, less than or equal, greater than or equal)

Parameters
[in]opComparison operation to be executed.
[in]input1First tensor input. Data types supported: QASYMM8/S16/F16/S32/F32.
[in]input2Second tensor input. Data types supported: Same as input1.
[in]outputOutput tensor. Data types supported: U16/U32.

Definition at line 948 of file NEElementwiseOperationKernel.cpp.

949 {
950  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(*input1->info(), *input2->info(), *output->info()));
951  configure_common(input1, input2, output);
952  switch(op)
953  {
955  _function = configure_comp_func<ComparisonOperation::Equal>(input1, input2, output);
956  break;
958  _function = configure_comp_func<ComparisonOperation::NotEqual>(input1, input2, output);
959  break;
961  _function = configure_comp_func<ComparisonOperation::Greater>(input1, input2, output);
962  break;
964  _function = configure_comp_func<ComparisonOperation::GreaterEqual>(input1, input2, output);
965  break;
967  _function = configure_comp_func<ComparisonOperation::Less>(input1, input2, output);
968  break;
970  _function = configure_comp_func<ComparisonOperation::LessEqual>(input1, input2, output);
971  break;
972  default:
973  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
974  }
975 }
#define ARM_COMPUTE_ERROR(...)
Print the given message then throw an std::runtime_error.
Definition: Error.h:261
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:327

References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::Equal, arm_compute::Greater, arm_compute::GreaterEqual, ITensor::info(), arm_compute::Less, arm_compute::LessEqual, and arm_compute::NotEqual.

◆ validate()

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

Static function to check if given info will lead to a valid configuration of NEComparisonOperationKernel.

Parameters
[in]opComparison operation to be executed.
[in]input1First tensor input info. Data types supported: QASYMM8/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 987 of file NEElementwiseOperationKernel.cpp.

988 {
989  ARM_COMPUTE_UNUSED(op);
990  ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input1, input2, output);
991  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(*input1, *input2, *output));
992  return Status{};
993 }
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:193
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:160
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Definition: Validate.h:163

References ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, and ARM_COMPUTE_UNUSED.

Referenced by NEElementwiseComparison::validate(), and NEElementwiseComparisonStatic< op >::validate().


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