Compute Library
 21.11
CLComparisonStatic< COP > Class Template Reference

Basic function to run CLComparisonKernel. More...

#include <CLComparison.h>

Collaboration diagram for CLComparisonStatic< COP >:
[legend]

Public Member Functions

void configure (ICLTensor *input1, ICLTensor *input2, ICLTensor *output)
 Comparison operations used by the class. More...
 
void configure (const CLCompileContext &compile_context, ICLTensor *input1, ICLTensor *input2, ICLTensor *output)
 Comparison operations used by the class. 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)
 Static function to check if given info will lead to a valid configuration of CLComparison. More...
 

Static Public Attributes

static constexpr ComparisonOperation operation = COP
 

Detailed Description

template<ComparisonOperation COP>
class arm_compute::CLComparisonStatic< COP >

Basic function to run CLComparisonKernel.

Definition at line 84 of file CLComparison.h.

Member Function Documentation

◆ configure() [1/2]

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

Comparison operations used by the class.

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.

Definition at line 64 of file CLComparison.cpp.

References CLComparison::configure(), and CLKernelLibrary::get().

65 {
66  configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output);
67 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output)
Comparison operations used by the class.

◆ configure() [2/2]

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

Comparison operations used by the class.

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.

Definition at line 70 of file CLComparison.cpp.

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

71 {
72  auto k = std::make_unique<CLComparisonKernel>();
73  k->configure(compile_context, input1, input2, output, COP);
74  _kernel = std::move(k);
75 
76  if(output->info()->dimension(0) > 1)
77  {
78  ICLTensor *broadcasted_info = (input1->info()->dimension(0) == 1) ? input1 : input2;
79 
80  if(broadcasted_info->info()->dimension(0) == 1)
81  {
82  _border_handler->configure(compile_context, broadcasted_info, _kernel->border_size(), BorderMode::REPLICATE);
83  }
84  }
85 }
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 
)
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.
Returns
a status

Definition at line 88 of file CLComparison.cpp.

References CLComparisonKernel::validate().

89 {
90  return CLComparisonKernel::validate(input1, input2, output, COP);
91 }
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.

Field Documentation

◆ operation

constexpr ComparisonOperation operation = COP
static

Definition at line 87 of file CLComparison.h.


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