Compute Library
 21.02
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...
 
void configure (const CLCompileContext &compile_context, ICLTensor *input1, ICLTensor *input2, ICLTensor *output, ComparisonOperation operation)
 Initialise the kernel's inputs and outputs. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction (CLRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLSimpleFunction (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLSimpleFunction (ICLSimpleFunction &&)=default
 Default move constructor. More...
 
ICLSimpleFunctionoperator= (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLSimpleFunctionoperator= (ICLSimpleFunction &&)=default
 Default move assignment operator. More...
 
 ~ICLSimpleFunction ()
 Default destructor. 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 38 of file CLComparison.h.

Member Function Documentation

◆ configure() [1/2]

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

Initialise the kernel's inputs and outputs.

Parameters
[in]input1Source tensor. Data types supported: All. 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.

References CLKernelLibrary::get().

Referenced by CLComparisonStatic< COP >::configure().

34 {
35  configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, operation);
36 }
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, ComparisonOperation operation)
Initialise the kernel&#39;s inputs and outputs.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
ICLTensor input1,
ICLTensor input2,
ICLTensor output,
ComparisonOperation  operation 
)

Initialise the kernel's inputs and outputs.

Parameters
[in]compile_contextThe compile context to be used.
[in]input1Source tensor. Data types supported: All. 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 38 of file CLComparison.cpp.

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

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

◆ 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: All.
[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 55 of file CLComparison.cpp.

References CLComparisonKernel::validate().

Referenced by arm_compute::test::validation::DATA_TEST_CASE().

56 {
57  return CLComparisonKernel::validate(input1, input2, output, operation);
58 }
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.

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