Compute Library
 21.02
NELogicalOr Class Reference

Basic function to perform logical OR. More...

#include <NELogical.h>

Collaboration diagram for NELogicalOr:
[legend]

Public Member Functions

 NELogicalOr ()
 Constructor. More...
 
 ~NELogicalOr ()
 Destructor. More...
 
 NELogicalOr (const NELogicalOr &)=delete
 
NELogicalOroperator= (const NELogicalOr &)=delete
 
 NELogicalOr (NELogicalOr &&)=default
 
NELogicalOroperator= (NELogicalOr &&)
 
void configure (const ITensor *input1, const ITensor *input2, ITensor *output)
 Initialise the kernel's inputs and output. 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 of NELogicalOr. More...
 

Detailed Description

Basic function to perform logical OR.

Definition at line 75 of file NELogical.h.

Constructor & Destructor Documentation

◆ NELogicalOr() [1/3]

Constructor.

Definition at line 74 of file NELogical.cpp.

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

75  : _impl(std::make_unique<Impl>())
76 {
77 }

◆ ~NELogicalOr()

~NELogicalOr ( )
default

Destructor.

Referenced by NELogicalOr::NELogicalOr().

◆ NELogicalOr() [2/3]

NELogicalOr ( const NELogicalOr )
delete

◆ NELogicalOr() [3/3]

NELogicalOr ( NELogicalOr &&  )
default

Member Function Documentation

◆ configure()

void configure ( const ITensor input1,
const ITensor input2,
ITensor output 
)

Initialise the kernel's inputs and output.

Parameters
[in]input1First tensor input. Data type supported: U8.
[in]input2Second tensor input. Data type supported: U8.
[out]outputOutput tensor. Data type supported: U8.

Definition at line 81 of file NELogical.cpp.

References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, ARM_COMPUTE_ERROR_ON_NULLPTR, ITensor::info(), and arm_compute::Or.

82 {
83  ARM_COMPUTE_ERROR_ON_NULLPTR(input1, input2, output);
84 
85  _impl->kernel = std::make_unique<kernels::NELogicalKernel>();
86  _impl->kernel->configure(input1->info(), input2->info(), output->info(), LogicalOperation::Or);
87 
88  _impl->pack = ITensorPack();
89  _impl->pack.add_tensor(TensorType::ACL_SRC_0, input1);
90  _impl->pack.add_tensor(TensorType::ACL_SRC_1, input2);
91  _impl->pack.add_tensor(TensorType::ACL_DST, output);
92 }
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161

◆ operator=() [1/2]

NELogicalOr & operator= ( NELogicalOr &&  )
default

◆ operator=() [2/2]

NELogicalOr& operator= ( const NELogicalOr )
delete

◆ 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 99 of file NELogical.cpp.

References Window::DimY, Scheduler::get(), and IScheduler::schedule_op().

100 {
101  NEScheduler::get().schedule_op(_impl->kernel.get(), Window::DimY, _impl->kernel->window(), _impl->pack);
102 }
virtual void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors)=0
Runs the kernel in the same thread as the caller synchronously.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45
static IScheduler & get()
Access the scheduler singleton.
Definition: Scheduler.cpp:94

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

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

Definition at line 94 of file NELogical.cpp.

References arm_compute::Or, and NELogicalKernel::validate().

95 {
96  return kernels::NELogicalKernel::validate(input1, input2, output, LogicalOperation::Or);
97 }
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, LogicalOperation op)
Static function to check if given info will lead to a valid configuration of NELogicalKernel.

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