39 : _memory_group(
std::move(memory_manager)), _digit_reverse_kernel(), _fft_kernels(), _scale_kernel(), _digit_reversed_input(), _digit_reverse_indices(), _num_ffts(0), _axis(0), _run_scale(false)
61 digit_reverse_config.
axis = config.
axis;
64 _digit_reverse_indices.
allocator()->
init(digit_reverse_indices_info);
65 _memory_group.
manage(&_digit_reversed_input);
66 _digit_reverse_kernel = std::make_unique<NEFFTDigitReverseKernel>();
67 _digit_reverse_kernel->configure(input, &_digit_reversed_input, &_digit_reverse_indices, digit_reverse_config);
71 _num_ffts = decomposed_vector.size();
72 _fft_kernels.resize(_num_ffts);
75 for(
unsigned int i = 0; i < _num_ffts; ++i)
77 const unsigned int radix_for_stage = decomposed_vector.at(i);
81 fft_kernel_info.
radix = radix_for_stage;
82 fft_kernel_info.
Nx = Nx;
84 _fft_kernels[i] = std::make_unique<NEFFTRadixStageKernel>();
85 _fft_kernels[i]->configure(&_digit_reversed_input, ((i == (_num_ffts - 1)) && !is_c2r) ? output :
nullptr, fft_kernel_info);
87 Nx *= radix_for_stage;
94 scale_config.
scale =
static_cast<float>(
N);
96 _scale_kernel = std::make_unique<NEFFTScaleKernel>();
97 is_c2r ? _scale_kernel->configure(&_digit_reversed_input, output, scale_config) : _scale_kernel->configure(output,
nullptr, scale_config);
106 std::copy_n(digit_reverse_cpu.data(),
N,
reinterpret_cast<unsigned int *
>(_digit_reverse_indices.
buffer()));
123 if((output !=
nullptr) && (output->
total_size() != 0))
141 for(
unsigned int i = 0; i < _num_ffts; ++i)
~NEFFT1D()
Default destructor.
unsigned int axis
Axis to run the FFT on.
void init(const TensorAllocator &allocator, const Coordinates &coords, TensorInfo &sub_info)
Shares the same backing memory with another tensor allocator, while the tensor info might be differen...
std::vector< unsigned int > decompose_stages(unsigned int N, const std::set< unsigned int > &supported_factors)
Decompose a given 1D input size using the provided supported factors.
Descriptor used by the FFT1D function.
std::vector< unsigned int > digit_reverse_indices(unsigned int N, const std::vector< unsigned int > &fft_stages)
Calculate digit reverse index vector given fft size and the decomposed stages.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
1 channel, 1 F32 per channel
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Store the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
unsigned int axis
Axis to run the kernel on.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
Interface for Neon tensor.
Copyright (c) 2017-2021 Arm Limited.
TensorAllocator * allocator()
Return a pointer to the tensor's allocator.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
void run() override
Run the kernels contained in the function.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
1 channel, 1 U32 per channel
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
void configure(const ITensor *input, ITensor *output, const FFT1DInfo &config)
Initialise the function's source and destinations.
bool conjugate
Flag to conjugate the output/.
void allocate() override
Allocate size specified by TensorInfo of CPU memory.
static std::set< unsigned int > supported_radix()
Returns the radix that are support by the FFT kernel.
Descriptor used by the FFT core kernels.
Descriptor for FFT scale kernels.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
unsigned int axis
Axis to perform the kernel on.
unsigned int radix
Radix to use.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Memory group resources scope handling class.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
bool is_first_stage
Flags if the FFT kernels is the first stage of a decomposed FFT.
Descriptor for FFT digit reverse kernels.
unsigned int Nx
Nx coefficient.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
uint8_t * buffer() const override
Interface to be implemented by the child class to return a pointer to CPU memory. ...
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const FFT1DInfo &config)
Static function to check if given info will lead to a valid configuration of NEFFT1D.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Store the tensor's metadata.
FFTDirection direction
Direction of the FFT.
float scale
Axis to perform the kernel on.
NEFFT1D(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Default Constructor.
virtual size_t num_channels() const =0
The number of channels for each tensor element.
bool conjugate
Flag to conjugate the output/.
static IScheduler & get()
Access the scheduler singleton.