Compute Library
 21.02
CLLogicalOr Class Reference

Basic function to run arm_compute::opencl::kernels::ClLogicalBinaryKernel. More...

#include <CLLogicalOr.h>

Collaboration diagram for CLLogicalOr:
[legend]

Public Member Functions

 CLLogicalOr ()
 Default Constructor. More...
 
 ~CLLogicalOr ()
 Default Destructor. More...
 
 CLLogicalOr (const CLLogicalOr &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLLogicalOr (CLLogicalOr &&)
 Default move constructor. More...
 
CLLogicalOroperator= (const CLLogicalOr &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLLogicalOroperator= (CLLogicalOr &&)
 Default move assignment operator. More...
 
void configure (ICLTensor *input1, ICLTensor *input2, ICLTensor *output)
 Initialize the function. More...
 
void configure (const CLCompileContext &compile_context, ICLTensor *input1, ICLTensor *input2, ICLTensor *output)
 Initialize the function. More...
 
void run () override
 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. More...
 

Detailed Description

Basic function to run arm_compute::opencl::kernels::ClLogicalBinaryKernel.

Note
The tensor data type for the inputs must be U8.
The function performs a logical OR operation using the two input tensors.

Definition at line 73 of file CLLogicalOr.h.

Constructor & Destructor Documentation

◆ CLLogicalOr() [1/3]

Default Constructor.

Definition at line 60 of file CLLogicalOr.cpp.

References CLLogicalOr::operator=(), and CLLogicalOr::~CLLogicalOr().

61  : _impl(std::make_unique<Impl>())
62 {
63 }

◆ ~CLLogicalOr()

~CLLogicalOr ( )
default

Default Destructor.

Referenced by CLLogicalOr::CLLogicalOr().

◆ CLLogicalOr() [2/3]

CLLogicalOr ( const CLLogicalOr )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ CLLogicalOr() [3/3]

CLLogicalOr ( CLLogicalOr &&  )
default

Default move constructor.

Member Function Documentation

◆ configure() [1/2]

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

Initialize the function.

Parameters
[in]input1Input tensor. Data types supported: U8.
[in]input2Input tensor. Data types supported: same as input1.
[out]outputOutput tensor. Data types supported: same as input1.

Definition at line 68 of file CLLogicalOr.cpp.

References CLKernelLibrary::get().

69 {
70  configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output);
71 }
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output)
Initialize the function.
Definition: CLLogicalOr.cpp:68
static CLKernelLibrary & get()
Access the KernelLibrary singleton.

◆ configure() [2/2]

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

Initialize the function.

Parameters
[in]compile_contextThe compile context to be used.
[in]input1Input tensor. Data types supported: U8.
[in]input2Input tensor. Data types supported: same as input1.
[out]outputOutput tensor. Data types supported: same as input1.

Definition at line 73 of file CLLogicalOr.cpp.

References ITensor::info().

74 {
75  _impl->src0 = input1;
76  _impl->src1 = input2;
77  _impl->dst = output;
78  _impl->op = std::make_unique<experimental::CLLogicalOr>();
79  _impl->op->configure(compile_context, input1->info(), input2->info(), output->info());
80 }

◆ operator=() [1/2]

CLLogicalOr& operator= ( const CLLogicalOr )
delete

Prevent instances of this class from being copied (As this class contains pointers)

Referenced by CLLogicalOr::CLLogicalOr().

◆ operator=() [2/2]

CLLogicalOr & operator= ( CLLogicalOr &&  )
default

Default move assignment operator.

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For Neon kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implements IFunction.

Definition at line 87 of file CLLogicalOr.cpp.

References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, and ITensorPack::add_tensor().

88 {
89  ITensorPack pack;
90  pack.add_tensor(TensorType::ACL_SRC_0, _impl->src0);
91  pack.add_tensor(TensorType::ACL_SRC_1, _impl->src1);
92  pack.add_tensor(TensorType::ACL_DST, _impl->dst);
93 
94  _impl->op->run(pack);
95 }

◆ 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.

Parameters
[in]input1First tensor input info. Data types supported: U8.
[in]input2Second tensor input info. Data types supported: same as input1.
[in]outputOutput tensor info. Data types supported: same as input1.
Returns
a status

Definition at line 82 of file CLLogicalOr.cpp.

References CLLogicalOr::validate().

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

83 {
84  return experimental::CLLogicalOr::validate(input1, input2, output);
85 }
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 arm_compute::opencl::ker...
Definition: CLLogicalOr.cpp:41

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