Compute Library
 21.02
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...
 

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

Referenced by NEFFTDigitReverseKernel::name().

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

◆ 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 77 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, ITensorInfo::num_channels(), and arm_compute::validate_arguments().

Referenced by NEFFTDigitReverseKernel::name().

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

◆ 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 254 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().

255 {
259  (this->*_func)(window);
260 }
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:941
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:205

◆ 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 137 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(), arm_compute::validate_arguments(), and IKernel::window().

Referenced by NEFFTDigitReverseKernel::name().

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

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