Compute Library
 21.02
CLLogicalNot Class Reference

Basic function to do logical NOT operation. More...

#include <CLLogicalNot.h>

Collaboration diagram for CLLogicalNot:
[legend]

Public Member Functions

 CLLogicalNot ()
 Default Constructor. More...
 
 ~CLLogicalNot ()
 Default Destructor. More...
 
 CLLogicalNot (const CLLogicalNot &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLLogicalNot (CLLogicalNot &&)
 Default move constructor. More...
 
CLLogicalNotoperator= (const CLLogicalNot &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLLogicalNotoperator= (CLLogicalNot &&)
 Default move assignment operator. More...
 
void configure (const ICLTensor *input, ICLTensor *output)
 Initialize the function. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, 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 *input, const ITensorInfo *output)
 Static function to check if given info will lead to a valid configuration. More...
 

Detailed Description

Basic function to do logical NOT operation.

Note
The tensor data type for the inputs must be U8.
The function performs a logical NOT operation on input tensor.

Definition at line 44 of file CLLogicalNot.h.

Constructor & Destructor Documentation

◆ CLLogicalNot() [1/3]

Default Constructor.

Definition at line 40 of file CLLogicalNot.cpp.

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

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

◆ ~CLLogicalNot()

~CLLogicalNot ( )
default

Default Destructor.

Referenced by CLLogicalNot::CLLogicalNot().

◆ CLLogicalNot() [2/3]

CLLogicalNot ( const CLLogicalNot )
delete

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

◆ CLLogicalNot() [3/3]

CLLogicalNot ( CLLogicalNot &&  )
default

Default move constructor.

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
ICLTensor output 
)

Initialize the function.

Parameters
[in]inputInput tensor. Data types supported: U8.
[out]outputOutput tensor. Data types supported: same as input.

Definition at line 48 of file CLLogicalNot.cpp.

References CLKernelLibrary::get().

49 {
50  configure(CLKernelLibrary::get().get_compile_context(), input, output);
51 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(const ICLTensor *input, ICLTensor *output)
Initialize the function.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
ICLTensor output 
)

Initialize the function.

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

Definition at line 53 of file CLLogicalNot.cpp.

References ITensor::info(), and arm_compute::test::validation::input.

54 {
55  _impl->src = input;
56  _impl->dst = output;
57  _impl->op = std::make_unique<opencl::ClLogicalNot>();
58  _impl->op->configure(compile_context, input->info(), output->info());
59 }

◆ operator=() [1/2]

CLLogicalNot& operator= ( const CLLogicalNot )
delete

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

Referenced by CLLogicalNot::CLLogicalNot().

◆ operator=() [2/2]

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

References arm_compute::ACL_DST, arm_compute::ACL_SRC, and ITensorPack::add_tensor().

67 {
68  ITensorPack pack;
69  pack.add_tensor(TensorType::ACL_SRC, _impl->src);
70  pack.add_tensor(TensorType::ACL_DST, _impl->dst);
71 
72  _impl->op->run(pack);
73 }

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output 
)
static

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

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

Definition at line 61 of file CLLogicalNot.cpp.

References ClLogicalNot::validate().

Referenced by arm_compute::test::validation::FIXTURE_DATA_TEST_CASE(), and arm_compute::test::validation::TEST_CASE().

62 {
63  return opencl::ClLogicalNot::validate(input, output);
64 }
static Status validate(const ITensorInfo *src, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.

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