Compute Library
 19.08
CLComparison Class Reference

Basic function to run CLComparisonKernel. More...

#include <CLComparison.h>

Collaboration diagram for CLComparison:
[legend]

Public Member Functions

void configure (ICLTensor *input1, ICLTensor *input2, ICLTensor *output, ComparisonOperation operation)
 Initialise the kernel's inputs and outputs. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction ()
 Default constructor. More...
 
void run () override final
 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, ComparisonOperation operation)
 Static function to check if given info will lead to a valid configuration of CLComparison. More...
 

Detailed Description

Basic function to run CLComparisonKernel.

Definition at line 36 of file CLComparison.h.

Member Function Documentation

◆ configure()

void configure ( ICLTensor input1,
ICLTensor input2,
ICLTensor output,
ComparisonOperation  operation 
)

Initialise the kernel's inputs and outputs.

Parameters
[in]input1Source tensor. Data types supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32. The input1 tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[in]input2Source tensor. Data types supported: Same as input1. The input2 tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[out]outputDestination tensor. Data types supported: U8.
[out]operationComparison operation to be used.

Definition at line 33 of file CLComparison.cpp.

34 {
35  auto k = arm_compute::support::cpp14::make_unique<CLComparisonKernel>();
36  k->configure(input1, input2, output, operation);
37  _kernel = std::move(k);
38 
39  if(output->info()->dimension(0) > 1)
40  {
41  ICLTensor *broadcasted_info = (input1->info()->dimension(0) == 1) ? input1 : input2;
42 
43  if(broadcasted_info->info()->dimension(0) == 1)
44  {
45  _border_handler.configure(broadcasted_info, _kernel->border_size(), BorderMode::REPLICATE);
46  }
47  }
48 }
Pixels outside the image are assumed to have the same value as the closest image pixel.

References ITensorInfo::dimension(), ITensor::info(), and arm_compute::REPLICATE.

◆ validate()

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

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

Parameters
[in]input1Source tensor. Data types supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32.
[in]input2Source tensor. Data types supported: Same as input1.
[in]outputDestination tensor. Data types supported: U8.
[out]operationComparison operation to be used.
Returns
a status

Definition at line 50 of file CLComparison.cpp.

51 {
52  return CLComparisonKernel::validate(input1, input2, output, operation);
53 }
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ComparisonOperation operation)
Static function to check if given info will lead to a valid configuration of CLComparisonKernel.

References CLComparisonKernel::validate().


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