Compute Library
 23.08
NEBitwiseNotKernel Class Reference

Interface for the kernel to perform bitwise NOT operation. More...

#include <NEBitwiseNotKernel.h>

Collaboration diagram for NEBitwiseNotKernel:
[legend]

Public Member Functions

const char * name () const override
 Name of the kernel. More...
 
 NEBitwiseNotKernel ()
 Default constructor. More...
 
 NEBitwiseNotKernel (const NEBitwiseNotKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEBitwiseNotKerneloperator= (const NEBitwiseNotKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEBitwiseNotKernel (NEBitwiseNotKernel &&)=default
 Allow instances of this class to be moved. More...
 
NEBitwiseNotKerneloperator= (NEBitwiseNotKernel &&)=default
 Allow instances of this class to be moved. More...
 
 ~NEBitwiseNotKernel ()=default
 Default destructor. More...
 
void configure (const ITensor *input, ITensor *output)
 Initialise the kernel's input and output. More...
 
void run (const Window &window, const ThreadInfo &info) override
 Execute the kernel on the passed window. More...
 
- Public Member Functions inherited from ICPPKernel
virtual ~ICPPKernel ()=default
 Default destructor. More...
 
virtual void run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator)
 legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More...
 
virtual void run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info)
 Execute the kernel on the passed window. More...
 
virtual size_t get_mws (const CPUInfo &platform, size_t thread_count) const
 Return minimum workload size of the relevant kernel. More...
 
- Public Member Functions inherited from IKernel
 IKernel ()
 Constructor. More...
 
virtual ~IKernel ()=default
 Destructor. More...
 
virtual bool is_parallelisable () const
 Indicates whether or not the kernel is parallelisable. More...
 
virtual BorderSize border_size () const
 The size of the border for that kernel. More...
 
const Windowwindow () const
 The maximum window the kernel can be executed on. More...
 
bool is_window_configured () const
 Function to check if the embedded window of this kernel has been configured. More...
 

Additional Inherited Members

- Static Public Attributes inherited from ICPPKernel
static constexpr size_t default_mws = 1
 

Detailed Description

Interface for the kernel to perform bitwise NOT operation.

Result is computed by:

\[ output(x,y) = \lnot input(x,y) \]

Definition at line 38 of file NEBitwiseNotKernel.h.

Constructor & Destructor Documentation

◆ NEBitwiseNotKernel() [1/3]

Default constructor.

Definition at line 53 of file NEBitwiseNotKernel.cpp.

54  : _input(nullptr), _output(nullptr)
55 {
56 }

◆ NEBitwiseNotKernel() [2/3]

NEBitwiseNotKernel ( const NEBitwiseNotKernel )
delete

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

◆ NEBitwiseNotKernel() [3/3]

Allow instances of this class to be moved.

◆ ~NEBitwiseNotKernel()

~NEBitwiseNotKernel ( )
default

Default destructor.

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
ITensor output 
)

Initialise the kernel's input and output.

Parameters
[in]inputAn input tensor. Data type supported: U8.
[out]outputThe output tensor. Data type supported: U8.

Definition at line 58 of file NEBitwiseNotKernel.cpp.

59 {
61 
62  set_shape_if_empty(*output->info(), input->info()->tensor_shape());
63 
66 
71 
72  _input = input;
73  _output = output;
74 
75  constexpr unsigned int num_elems_processed_per_iteration = 16;
76 
77  // Configure kernel window
81 
82  INEKernel::configure(win);
83 }

References ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_ERROR_ON_MISMATCHING_SHAPES, ARM_COMPUTE_ERROR_ON_NULLPTR, arm_compute::calculate_max_window(), arm_compute::test::validation::configure(), ITensor::info(), arm_compute::test::validation::input, num_elems_processed_per_iteration, arm_compute::set_format_if_unknown(), arm_compute::set_shape_if_empty(), arm_compute::U8, and arm_compute::update_window_and_padding().

◆ name()

const char* name ( ) const
inlineoverridevirtual

Name of the kernel.

Returns
Kernel name

Implements ICPPKernel.

Definition at line 41 of file NEBitwiseNotKernel.h.

42  {
43  return "NEBitwiseNotKernel";
44  }

◆ operator=() [1/2]

NEBitwiseNotKernel& operator= ( const NEBitwiseNotKernel )
delete

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

◆ operator=() [2/2]

NEBitwiseNotKernel& operator= ( NEBitwiseNotKernel &&  )
default

Allow instances of this class to be moved.

◆ run()

void run ( const Window window,
const ThreadInfo info 
)
overridevirtual

Execute the kernel on the passed window.

Warning
If is_parallelisable() returns false then the passed window must be equal to window()
Note
The window has to be a region within the window returned by the window() method
The width of the window has to be a multiple of num_elems_processed_per_iteration().
Parameters
[in]windowRegion on which to execute the kernel. (Must be a region of the window returned by window())
[in]infoInfo about executing thread and CPU.

Reimplemented from ICPPKernel.

Definition at line 85 of file NEBitwiseNotKernel.cpp.

86 {
90  Iterator input(_input, window);
91  Iterator output(_output, window);
92 
94  {
95  bitwise_not_U8_U8(input.ptr(), output.ptr());
96  },
97  input, output);
98 }

References ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, arm_compute::execute_window_loop(), arm_compute::test::validation::info, arm_compute::test::validation::input, Iterator::ptr(), and IKernel::window().


The documentation for this class was generated from the following files:
arm_compute::Steps
Class to describe a number of elements in each dimension.
Definition: Steps.h:40
ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Definition: Validate.h:875
arm_compute::calculate_max_window
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
Definition: WindowHelpers.cpp:28
ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:1004
arm_compute::AccessWindowHorizontal
Implementation of a row access pattern.
Definition: IAccessWindow.h:232
arm_compute::update_window_and_padding
bool update_window_and_padding(Window &win, Ts &&... patterns)
Update window and padding size for each of the access patterns.
Definition: WindowHelpers.h:46
ARM_COMPUTE_ERROR_ON_NULLPTR
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161
arm_compute::ITensor::info
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
arm_compute::Iterator
Iterator updated by execute_window_loop for each window element.
Definition: Helpers.h:46
arm_compute::DataType::U8
@ U8
unsigned 8-bit number
ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:205
ARM_COMPUTE_UNUSED
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152
arm_compute::Coordinates
Coordinates of an item.
Definition: Coordinates.h:37
arm_compute::Format::U8
@ U8
1 channel, 1 U8 per channel
arm_compute::IKernel::window
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
arm_compute::set_shape_if_empty
bool set_shape_if_empty(ITensorInfo &info, const TensorShape &shape)
Set the shape to the specified value if the current assignment is empty.
Definition: AutoConfiguration.h:94
arm_compute::Window
Describe a multidimensional execution window.
Definition: Window.h:39
arm_compute::set_format_if_unknown
bool set_format_if_unknown(ITensorInfo &info, Format format)
Set the format, data type and number of channels to the specified value if the current data type is u...
Definition: AutoConfiguration.h:113
arm_compute::test::validation::info
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
arm_compute::execute_window_loop
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&... iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
Definition: Helpers.inl:77
ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Definition: Validate.h:628
num_elems_processed_per_iteration
unsigned int num_elems_processed_per_iteration
Definition: ClIm2ColKernel.cpp:59
arm_compute::test::validation::input
auto input
Definition: LSTMLayerQuantized.cpp:486
ARM_COMPUTE_ERROR_ON_MISMATCHING_SHAPES
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_SHAPES(...)
Definition: Validate.h:526