37 : _memory_group(
std::move(memory_manager)),
41 _digit_reversed_input(),
42 _digit_reverse_indices(),
72 digit_reverse_config.
axis = config.
axis;
75 _digit_reverse_indices.
allocator()->
init(digit_reverse_indices_info);
76 _memory_group.
manage(&_digit_reversed_input);
77 _digit_reverse_kernel->configure(compile_context, input, &_digit_reversed_input, &_digit_reverse_indices, digit_reverse_config);
81 _num_ffts = decomposed_vector.size();
82 _fft_kernels.reserve(_num_ffts);
83 for(
unsigned int i = 0; i < _num_ffts; ++i)
85 const unsigned int radix_for_stage = decomposed_vector.at(i);
89 fft_kernel_info.
radix = radix_for_stage;
90 fft_kernel_info.
Nx = Nx;
92 _fft_kernels.emplace_back(std::make_unique<CLFFTRadixStageKernel>());
93 _fft_kernels.back()->configure(compile_context, &_digit_reversed_input, ((i == (_num_ffts - 1)) && !is_c2r) ? output :
nullptr, fft_kernel_info);
95 Nx *= radix_for_stage;
102 scale_config.
scale =
static_cast<float>(
N);
104 is_c2r ? _scale_kernel->configure(compile_context, &_digit_reversed_input, output, scale_config) : _scale_kernel->configure(output,
nullptr, scale_config);
114 std::copy_n(digit_reverse_cpu.data(),
N,
reinterpret_cast<unsigned int *
>(_digit_reverse_indices.
buffer()));
132 if((output !=
nullptr) && (output->
total_size() != 0))
151 for(
unsigned int i = 0; i < _num_ffts; ++i)
unsigned int axis
Axis to run the FFT on.
void configure(const ICLTensor *input, ICLTensor *output, const FFT1DInfo &config)
Initialise the function's source, destinations and border mode.
static CLScheduler & get()
Access the scheduler singleton.
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.
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 CLFFT1D.
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.
~CLFFT1D()
Default destructor.
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.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Store the tensor's metadata.
CLTensorAllocator * allocator()
Return a pointer to the tensor's allocator.
#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.
void init(const TensorInfo &input, size_t alignment=0)
Initialize a tensor based on the passed TensorInfo.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
void map(bool blocking=true)
Enqueue a map operation of the allocated buffer.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
uint8_t * buffer() const override
Interface to be implemented by the child class to return a pointer to CPU memory. ...
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
1 channel, 1 U32 per channel
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
bool conjugate
Flag to conjugate the output/.
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.
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
static std::set< unsigned int > supported_radix()
Returns the radix that are support by the FFT kernel.
unsigned int axis
Axis to perform the kernel on.
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
unsigned int radix
Radix to use.
Interface for the inverse fft scale kernel.
Memory group resources scope handling class.
Interface for OpenCL tensor.
CLFFT1D(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Default Constructor.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
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(...)
#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.
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_NOT_IN(t,...)
void run() override
Run the kernels contained in the function.
void unmap()
Enqueue an unmap operation of the allocated and mapped buffer.
virtual size_t num_channels() const =0
The number of channels for each tensor element.
bool conjugate
Flag to conjugate the output/.
Interface for the digit reverse operation kernel.