Compute Library
 22.05
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.

Valid data layouts:

  • All

Valid data type configurations:

src0 src1 dst
All All U8
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 35 of file CLComparison.cpp.

References CLKernelLibrary::get().

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

36 {
37  configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, operation);
38 }
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 40 of file CLComparison.cpp.

References ARM_COMPUTE_LOG_PARAMS, ITensorInfo::dimension(), ITensor::info(), arm_compute::test::validation::k, and arm_compute::REPLICATE.

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

◆ 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 58 of file CLComparison.cpp.

References CLComparisonKernel::validate().

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

59 {
60  return CLComparisonKernel::validate(input1, input2, output, operation);
61 }
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: