Compute Library
 21.02
NELogicalNot Class Reference

Basic function to perform logical NOT. More...

#include <NELogical.h>

Collaboration diagram for NELogicalNot:
[legend]

Public Member Functions

 NELogicalNot ()
 Constructor. More...
 
 ~NELogicalNot ()
 Destructor. More...
 
 NELogicalNot (const NELogicalNot &)=delete
 
NELogicalNotoperator= (const NELogicalNot &)=delete
 
 NELogicalNot (NELogicalNot &&)=default
 
NELogicalNotoperator= (NELogicalNot &&)
 
void configure (const ITensor *input, 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 *input, const ITensorInfo *output)
 Static function to check if given info will lead to a valid configuration of NELogicalNot. More...
 

Detailed Description

Basic function to perform logical NOT.

Definition at line 110 of file NELogical.h.

Constructor & Destructor Documentation

◆ NELogicalNot() [1/3]

Constructor.

Definition at line 107 of file NELogical.cpp.

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

108  : _impl(std::make_unique<Impl>())
109 {
110 }

◆ ~NELogicalNot()

~NELogicalNot ( )
default

Destructor.

Referenced by NELogicalNot::NELogicalNot().

◆ NELogicalNot() [2/3]

NELogicalNot ( const NELogicalNot )
delete

◆ NELogicalNot() [3/3]

NELogicalNot ( NELogicalNot &&  )
default

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
ITensor output 
)

Initialise the kernel's inputs and output.

Parameters
[in]inputInput tensor. Data type supported: U8.
[out]outputOutput tensor. Data type supported: U8.

Definition at line 114 of file NELogical.cpp.

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

115 {
117 
118  _impl->kernel = std::make_unique<kernels::NELogicalKernel>();
119  _impl->kernel->configure(input->info(), nullptr, output->info(), LogicalOperation::Not);
120 
121  _impl->pack = ITensorPack();
122  _impl->pack.add_tensor(TensorType::ACL_SRC_0, input);
123  _impl->pack.add_tensor(TensorType::ACL_DST, output);
124 }
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161

◆ operator=() [1/2]

NELogicalNot & operator= ( NELogicalNot &&  )
default

◆ operator=() [2/2]

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

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

132 {
133  NEScheduler::get().schedule_op(_impl->kernel.get(), Window::DimY, _impl->kernel->window(), _impl->pack);
134 }
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 input,
const ITensorInfo output 
)
static

Static function to check if given info will lead to a valid configuration of NELogicalNot.

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

Definition at line 126 of file NELogical.cpp.

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

127 {
129 }
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: