Compute Library
 21.08
NEFFTDigitReverseKernel Class Reference

Interface for the digit reverse operation kernel. More...

#include <NEFFTDigitReverseKernel.h>

Collaboration diagram for NEFFTDigitReverseKernel:
[legend]

Public Member Functions

const char * name () const override
 Name of the kernel. More...
 
 NEFFTDigitReverseKernel ()
 Constructor. More...
 
 NEFFTDigitReverseKernel (const NEFFTDigitReverseKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEFFTDigitReverseKerneloperator= (const NEFFTDigitReverseKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEFFTDigitReverseKernel (NEFFTDigitReverseKernel &&)=default
 Default Move Constructor. More...
 
NEFFTDigitReverseKerneloperator= (NEFFTDigitReverseKernel &&)=default
 Default move assignment operator. More...
 
 ~NEFFTDigitReverseKernel ()=default
 Default destructor. More...
 
void configure (const ITensor *input, ITensor *output, const ITensor *idx, const FFTDigitReverseKernelInfo &config)
 Set the input and output tensors. 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...
 
- 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...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *idx, const FFTDigitReverseKernelInfo &config)
 Static function to check if given info will lead to a valid configuration of NEFFTDigitReverseKernel. More...
 

Detailed Description

Interface for the digit reverse operation kernel.

Definition at line 36 of file NEFFTDigitReverseKernel.h.

Constructor & Destructor Documentation

◆ NEFFTDigitReverseKernel() [1/3]

Constructor.

Definition at line 71 of file NEFFTDigitReverseKernel.cpp.

Referenced by NEFFTDigitReverseKernel::name().

72  : _func(nullptr), _input(nullptr), _output(nullptr), _idx(nullptr)
73 {
74 }

◆ NEFFTDigitReverseKernel() [2/3]

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

◆ NEFFTDigitReverseKernel() [3/3]

Default Move Constructor.

◆ ~NEFFTDigitReverseKernel()

Default destructor.

Referenced by NEFFTDigitReverseKernel::name().

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
ITensor output,
const ITensor idx,
const FFTDigitReverseKernelInfo config 
)

Set the input and output tensors.

Parameters
[in]inputSource tensor. Data types supported: F32. Number of channels supported: 1 (real tensor) or 2 (complex tensor).
[out]outputDestination tensor. Data type supported: same as input. Number of channels supported: 2 (complex tensor).
[in]idxDigit reverse index tensor. Data type supported: U32
[in]configKernel configuration.

Definition at line 76 of file NEFFTDigitReverseKernel.cpp.

References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, FFTDigitReverseKernelInfo::axis, FFTDigitReverseKernelInfo::conjugate, ITensor::info(), arm_compute::test::validation::input, and ITensorInfo::num_channels().

Referenced by NEFFTDigitReverseKernel::name().

77 {
78  ARM_COMPUTE_ERROR_ON_NULLPTR(input, output, idx);
79  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info(), idx->info(), config));
80 
81  _input = input;
82  _output = output;
83  _idx = idx;
84 
85  const size_t axis = config.axis;
86  const bool is_conj = config.conjugate;
87  const bool is_input_complex = (input->info()->num_channels() == 2);
88 
89  // Configure kernel window
90  auto win_config = validate_and_configure_window(input->info(), output->info(), idx->info(), config);
91  ARM_COMPUTE_ERROR_THROW_ON(win_config.first);
92  INEKernel::configure(win_config.second);
93 
94  if(axis == 0)
95  {
96  if(is_input_complex)
97  {
98  if(is_conj)
99  {
100  _func = &NEFFTDigitReverseKernel::digit_reverse_kernel_axis_0<true, true>;
101  }
102  else
103  {
104  _func = &NEFFTDigitReverseKernel::digit_reverse_kernel_axis_0<true, false>;
105  }
106  }
107  else
108  {
109  _func = &NEFFTDigitReverseKernel::digit_reverse_kernel_axis_0<false, false>;
110  }
111  }
112  else if(axis == 1)
113  {
114  if(is_input_complex)
115  {
116  if(is_conj)
117  {
118  _func = &NEFFTDigitReverseKernel::digit_reverse_kernel_axis_1<true, true>;
119  }
120  else
121  {
122  _func = &NEFFTDigitReverseKernel::digit_reverse_kernel_axis_1<true, false>;
123  }
124  }
125  else
126  {
127  _func = &NEFFTDigitReverseKernel::digit_reverse_kernel_axis_1<false, false>;
128  }
129  }
130  else
131  {
132  ARM_COMPUTE_ERROR("Not supported");
133  }
134 }
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:455
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:157

◆ name()

◆ operator=() [1/2]

NEFFTDigitReverseKernel& operator= ( const NEFFTDigitReverseKernel )
delete

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

Referenced by NEFFTDigitReverseKernel::name().

◆ operator=() [2/2]

NEFFTDigitReverseKernel& operator= ( NEFFTDigitReverseKernel &&  )
default

Default move assignment operator.

◆ 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 253 of file NEFFTDigitReverseKernel.cpp.

References ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, and IKernel::window().

Referenced by NEFFTDigitReverseKernel::name().

254 {
258  (this->*_func)(window);
259 }
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:915
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:201

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
const ITensorInfo idx,
const FFTDigitReverseKernelInfo config 
)
static

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

Parameters
[in]inputSource tensor info. Data types supported: F32. Number of channels supported: 1 (real tensor) or 2 (complex tensor).
[in]outputDestination tensor info. Data type supported: same as input. Number of channels supported: 2 (complex tensor).
[in]idxDigit reverse index tensor info. Data type supported: U32
[in]configKernel configuration
Returns
a status

Definition at line 136 of file NEFFTDigitReverseKernel.cpp.

References ARM_COMPUTE_RETURN_ON_ERROR, ITensor::buffer(), ICloneable< T >::clone(), ITensorInfo::dimension(), Window::DimX, arm_compute::execute_window_loop(), ITensor::info(), N, Iterator::ptr(), Window::set(), arm_compute::test::validation::reference::slice(), ITensorInfo::strides_in_bytes(), and IKernel::window().

Referenced by NEFFTDigitReverseKernel::name().

137 {
138  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output, idx, config));
139  ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(input->clone().get(), output->clone().get(), idx->clone().get(), config).first);
140  return Status{};
141 }
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:204

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