Compute Library
 21.02
NELogicalAnd Class Reference

Basic function to perform logical AND. More...

#include <NELogical.h>

Collaboration diagram for NELogicalAnd:
[legend]

Public Member Functions

 NELogicalAnd ()
 Constructor. More...
 
 ~NELogicalAnd ()
 Destructor. More...
 
 NELogicalAnd (const NELogicalAnd &)=delete
 
NELogicalAndoperator= (const NELogicalAnd &)=delete
 
 NELogicalAnd (NELogicalAnd &&)=default
 
NELogicalAndoperator= (NELogicalAnd &&)
 
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 NELogicalAnd. More...
 

Detailed Description

Basic function to perform logical AND.

Definition at line 40 of file NELogical.h.

Constructor & Destructor Documentation

◆ NELogicalAnd() [1/3]

Constructor.

Definition at line 41 of file NELogical.cpp.

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

42  : _impl(std::make_unique<Impl>())
43 {
44 }

◆ ~NELogicalAnd()

~NELogicalAnd ( )
default

Destructor.

Referenced by NELogicalAnd::NELogicalAnd().

◆ NELogicalAnd() [2/3]

NELogicalAnd ( const NELogicalAnd )
delete

◆ NELogicalAnd() [3/3]

NELogicalAnd ( NELogicalAnd &&  )
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 48 of file NELogical.cpp.

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

49 {
50  ARM_COMPUTE_ERROR_ON_NULLPTR(input1, input2, output);
51 
52  _impl->kernel = std::make_unique<kernels::NELogicalKernel>();
53  _impl->kernel->configure(input1->info(), input2->info(), output->info(), LogicalOperation::And);
54 
55  _impl->pack = ITensorPack();
56  _impl->pack.add_tensor(TensorType::ACL_SRC_0, input1);
57  _impl->pack.add_tensor(TensorType::ACL_SRC_1, input2);
58  _impl->pack.add_tensor(TensorType::ACL_DST, output);
59 }
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161

◆ operator=() [1/2]

NELogicalAnd & operator= ( NELogicalAnd &&  )
default

◆ operator=() [2/2]

NELogicalAnd& operator= ( const NELogicalAnd )
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 66 of file NELogical.cpp.

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

67 {
68  NEScheduler::get().schedule_op(_impl->kernel.get(), Window::DimY, _impl->kernel->window(), _impl->pack);
69 }
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 NELogicalAnd.

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

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

62 {
63  return kernels::NELogicalKernel::validate(input1, input2, output, LogicalOperation::And);
64 }
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: