Compute Library
 21.02
NEFFTScaleKernel Class Reference

Interface for the inverse fft scale kernel. More...

#include <NEFFTScaleKernel.h>

Collaboration diagram for NEFFTScaleKernel:
[legend]

Public Member Functions

const char * name () const override
 Name of the kernel. More...
 
 NEFFTScaleKernel ()
 Constructor. More...
 
 NEFFTScaleKernel (const NEFFTScaleKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEFFTScaleKerneloperator= (const NEFFTScaleKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEFFTScaleKernel (NEFFTScaleKernel &&)=default
 Default Move Constructor. More...
 
NEFFTScaleKerneloperator= (NEFFTScaleKernel &&)=default
 Default move assignment operator. More...
 
 ~NEFFTScaleKernel ()=default
 Default destructor. More...
 
void configure (ITensor *input, ITensor *output, const FFTScaleKernelInfo &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 FFTScaleKernelInfo &config)
 Static function to check if given info will lead to a valid configuration of NEFFTScaleKernel. More...
 

Detailed Description

Interface for the inverse fft scale kernel.

Definition at line 37 of file NEFFTScaleKernel.h.

Constructor & Destructor Documentation

◆ NEFFTScaleKernel() [1/3]

Constructor.

Definition at line 89 of file NEFFTScaleKernel.cpp.

Referenced by NEFFTScaleKernel::name().

90  : _input(nullptr), _output(nullptr), _scale(), _run_in_place(false), _is_conj(false)
91 {
92 }

◆ NEFFTScaleKernel() [2/3]

NEFFTScaleKernel ( const NEFFTScaleKernel )
delete

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

◆ NEFFTScaleKernel() [3/3]

Default Move Constructor.

◆ ~NEFFTScaleKernel()

~NEFFTScaleKernel ( )
default

Default destructor.

Referenced by NEFFTScaleKernel::name().

Member Function Documentation

◆ configure()

void configure ( ITensor input,
ITensor output,
const FFTScaleKernelInfo config 
)

Set the input and output tensors.

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

Definition at line 94 of file NEFFTScaleKernel.cpp.

References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, FFTScaleKernelInfo::conjugate, ITensor::info(), arm_compute::test::validation::input, FFTScaleKernelInfo::scale, and arm_compute::validate_arguments().

Referenced by NEFFTScaleKernel::name().

95 {
97  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), (output != nullptr) ? output->info() : nullptr));
98 
99  _input = input;
100  _output = output;
101  _run_in_place = (output == nullptr) || (output == input);
102  _is_conj = config.conjugate;
103  _scale = config.scale;
104 
105  // Configure kernel window
106  auto win_config = validate_and_configure_window(input->info(), _run_in_place ? nullptr : output->info());
107  ARM_COMPUTE_ERROR_THROW_ON(win_config.first);
108  INEKernel::configure(win_config.second);
109 }
#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()

const char* name ( ) const
inlineoverridevirtual

◆ operator=() [1/2]

NEFFTScaleKernel& operator= ( const NEFFTScaleKernel )
delete

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

Referenced by NEFFTScaleKernel::name().

◆ operator=() [2/2]

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

References ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, Window::DimX, arm_compute::execute_window_loop(), Iterator::ptr(), Window::set(), and IKernel::window().

Referenced by NEFFTScaleKernel::name().

121 {
125 
126  Window input_window = window;
127  input_window.set(Window::DimX, 0);
128 
129  Iterator in(_input, input_window);
130  Iterator out(_run_in_place ? _input : _output, input_window);
131 
132  execute_window_loop(window, [&](const Coordinates &)
133  {
134  scale_complex(reinterpret_cast<float *>(in.ptr()), reinterpret_cast<float *>(out.ptr()), _is_conj, _scale);
135  },
136  in, out);
137 }
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Definition: Window.h:43
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
Definition: Window.inl:49
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:941
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
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
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:205

◆ validate()

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

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

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

Definition at line 111 of file NEFFTScaleKernel.cpp.

References ARM_COMPUTE_RETURN_ON_ERROR, ARM_COMPUTE_UNUSED, ICloneable< T >::clone(), and arm_compute::validate_arguments().

Referenced by NEFFTScaleKernel::name().

112 {
113  ARM_COMPUTE_UNUSED(config);
115  ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(input->clone().get(), output->clone().get()).first);
116 
117  return Status{};
118 }
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:204
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152
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: