24.02.1
|
Go to the documentation of this file.
39 : _memory_group(std::move(memory_manager)),
43 _digit_reversed_input(),
44 _digit_reverse_indices(),
68 const unsigned int N =
input->info()->tensor_shape()[config.
axis];
78 digit_reverse_config.
axis = config.
axis;
81 _digit_reverse_indices.
allocator()->
init(digit_reverse_indices_info);
82 _memory_group.
manage(&_digit_reversed_input);
83 _digit_reverse_kernel->configure(compile_context,
input, &_digit_reversed_input, &_digit_reverse_indices,
84 digit_reverse_config);
88 _num_ffts = decomposed_vector.size();
89 _fft_kernels.reserve(_num_ffts);
90 for (
unsigned int i = 0; i < _num_ffts; ++i)
92 const unsigned int radix_for_stage = decomposed_vector.at(i);
96 fft_kernel_info.
radix = radix_for_stage;
97 fft_kernel_info.
Nx = Nx;
99 _fft_kernels.emplace_back(std::make_unique<CLFFTRadixStageKernel>());
100 _fft_kernels.back()->configure(compile_context, &_digit_reversed_input,
101 ((i == (_num_ffts - 1)) && !is_c2r) ? output :
nullptr, fft_kernel_info);
103 Nx *= radix_for_stage;
110 scale_config.
scale =
static_cast<float>(
N);
112 is_c2r ? _scale_kernel->configure(compile_context, &_digit_reversed_input, output, scale_config)
113 : _scale_kernel->configure(output,
nullptr, scale_config);
123 std::copy_n(digit_reverse_cpu.data(),
N,
reinterpret_cast<unsigned int *
>(_digit_reverse_indices.
buffer()));
136 const unsigned int N =
input->tensor_shape()[config.
axis];
141 if ((output !=
nullptr) && (output->
total_size() != 0))
160 for (
unsigned int i = 0; i < _num_ffts; ++i)
float scale
Axis to perform the kernel on.
void unmap()
Enqueue an unmap operation of the allocated and mapped buffer.
~CLFFT1D()
Default destructor.
virtual size_t num_channels() const =0
The number of channels for each tensor element.
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
Interface for the digit reverse operation kernel.
void run() override
Run the kernels contained in the function.
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
void init(const TensorInfo &input, size_t alignment=0)
Initialize a tensor based on the passed TensorInfo.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
unsigned int Nx
Nx coefficient.
static std::set< unsigned int > supported_radix()
Returns the radix that are support by the FFT kernel.
Interface for OpenCL tensor.
Descriptor for FFT digit reverse kernels.
void map(bool blocking=true)
Enqueue a map operation of the allocated buffer.
unsigned int radix
Radix to use.
Descriptor used by the FFT core kernels.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
bool is_first_stage
Flags if the FFT kernels is the first stage of a decomposed FFT.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
uint8_t * buffer() const override
Interface to be implemented by the child class to return a pointer to CPU memory.
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.
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.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
@ U32
unsigned 32-bit number
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_NOT_IN(t,...)
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
Descriptor for FFT scale kernels.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
unsigned int axis
Axis to run the FFT on.
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
CLTensorAllocator * allocator()
Return a pointer to the tensor's allocator.
Descriptor used by the FFT1D function.
static CLScheduler & get()
Access the scheduler singleton.
unsigned int axis
Axis to run the kernel on.
Store the tensor's metadata.
FFTDirection direction
Direction of the FFT.
Memory group resources scope handling class.
Copyright (c) 2017-2024 Arm Limited.
@ F16
16-bit floating-point number
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
bool conjugate
Flag to conjugate the output/.
Store the tensor's metadata.
bool conjugate
Flag to conjugate the output/.
@ F32
32-bit floating-point number
Interface for the inverse fft scale kernel.
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.
#define ARM_COMPUTE_LOG_PARAMS(...)
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.
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.
void configure(const ICLTensor *input, ICLTensor *output, const FFT1DInfo &config)
Initialise the function's source, destinations and border mode.