1 #ifndef VIENNACL_FFT_HPP
2 #define VIENNACL_FFT_HPP
43 return !((data_size > 2) && (data_size & (data_size - 1)));
55 template<
class NumericT,
unsigned int AlignmentV>
61 if (!viennacl::detail::fft::is_radix2(size))
79 template<
class NumericT,
unsigned int AlignmentV>
84 if (viennacl::detail::fft::is_radix2(size))
99 template<
class NumericT,
unsigned int AlignmentV>
109 if (viennacl::detail::fft::is_radix2(cols_num))
124 if (viennacl::detail::fft::is_radix2(rows_num))
147 template<
class NumericT,
unsigned int AlignmentV>
157 if (viennacl::detail::fft::is_radix2(cols_num))
168 if (viennacl::detail::fft::is_radix2(rows_num))
195 template<
class NumericT,
unsigned int AlignmentV>
198 viennacl::inplace_fft(input, batch_num,
NumericT(1.0));
212 template<
class NumericT,
unsigned int AlignmentV>
231 template<
class NumericT,
unsigned int AlignmentV>
236 assert(input1.
size() == input2.
size());
237 assert(input1.
size() == output.
size());
251 viennacl::ifft(tmp3, output);
263 template<
class NumericT,
unsigned int AlignmentV>
268 assert(input1.
size() == input2.
size());
269 assert(input1.
size() == output.
size());
271 viennacl::inplace_fft(input1);
272 viennacl::inplace_fft(input2);
276 viennacl::inplace_ifft(output);
Implementation of the dense matrix class.
void normalize(viennacl::vector< NumericT, AlignmentV > &input)
Normalize vector on with his own size.
Implementations of Fast Furier Transformation.
vcl_size_t size(VectorType const &vec)
Generic routine for obtaining the size of a vector (ViennaCL, uBLAS, etc.)
void multiply_complex(viennacl::vector< NumericT, AlignmentV > const &input1, viennacl::vector< NumericT, AlignmentV > const &input2, viennacl::vector< NumericT, AlignmentV > &output)
Mutiply two complex vectors and store result in output.
size_type size2() const
Returns the number of columns.
size_type size1() const
Returns the number of rows.
void convolve_i(viennacl::vector< SCALARTYPE, ALIGNMENT > &input1, viennacl::vector< SCALARTYPE, ALIGNMENT > &input2, viennacl::vector< SCALARTYPE, ALIGNMENT > &output)
void radix2(viennacl::matrix< NumericT, viennacl::row_major, AlignmentV > &in, vcl_size_t size, vcl_size_t stride, vcl_size_t batch_num, NumericT sign=NumericT(-1), viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::DATA_ORDER data_order=viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR)
Radix-2 1D algorithm for computing Fourier transformation.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
void copy(std::vector< NumericT > &cpu_vec, circulant_matrix< NumericT, AlignmentV > &gpu_mat)
Copies a circulant matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU) ...
size_type size() const
Returns the length of the vector (cf. std::vector)
size_type internal_size2() const
Returns the internal number of columns. Usually required for launching OpenCL kernels only...
ScalarType convolve(std::vector< ScalarType > &in1, std::vector< ScalarType > &in2, unsigned int, unsigned int, unsigned int)
Extracts the underlying OpenCL handle from a vector, a matrix, an expression etc. ...
void direct(viennacl::vector< NumericT, AlignmentV > const &in, viennacl::vector< NumericT, AlignmentV > &out, vcl_size_t size, vcl_size_t stride, vcl_size_t batch_num, NumericT sign=NumericT(-1), viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::DATA_ORDER data_order=viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR)
Direct 1D algorithm for computing Fourier transformation.
ScalarType fft(std::vector< ScalarType > &in, std::vector< ScalarType > &out, unsigned int, unsigned int, unsigned int batch_size)
SCALARTYPE sign(SCALARTYPE val)