1 #ifndef VIENNACL_LINALG_OPENCL_FFT_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_OPENCL_FFT_OPERATIONS_HPP_
98 template<
typename NumericT>
118 static_cast<cl_uint>(size),
119 static_cast<cl_uint>(stride),
120 static_cast<cl_uint>(batch_num),
129 template<
typename NumericT>
148 static_cast<cl_uint>(bits_datasize), static_cast<cl_uint>(size),
149 static_cast<cl_uint>(stride), static_cast<cl_uint>(batch_num))
160 template<
typename NumericT>
169 assert(batch_num != 0 &&
bool(
"batch_num must be larger than 0"));
185 static_cast<cl_uint>(bits_datasize), static_cast<cl_uint>(size),
186 static_cast<cl_uint>(stride), static_cast<cl_uint>(batch_num),
sign));
191 viennacl::linalg::opencl::reorder<NumericT>(in,
size,
stride, bits_datasize, batch_num);
197 static_cast<cl_uint>(
step), static_cast<cl_uint>(bits_datasize),
198 static_cast<cl_uint>(size), static_cast<cl_uint>(stride),
199 static_cast<cl_uint>(batch_num),
sign));
211 template<
typename NumericT,
unsigned int AlignmentV>
245 template<
typename NumericT,
unsigned int AlignmentV>
260 template<
typename NumericT,
unsigned int AlignmentV>
276 template<
typename NumericT,
unsigned int AlignmentV>
290 template<
typename NumericT,
unsigned int AlignmentV>
305 template<
typename NumericT>
319 template<
typename NumericT>
333 template<
typename NumericT>
void reorder(viennacl::ocl::handle< cl_mem > const &in, vcl_size_t size, vcl_size_t stride, vcl_size_t bits_datasize, vcl_size_t batch_num, viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::DATA_ORDER data_order=viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR)
OpenCL kernel file for FFT operations.
vcl_size_t next_power_2(vcl_size_t n)
Find next power of two.
Represents an OpenCL device within ViennaCL.
void complex_to_real(viennacl::vector_base< NumericT > const &in, viennacl::vector_base< NumericT > &out, vcl_size_t size)
Create real vector from complex vector (even elements(2*k) = real part, odd elements(2*k+1) = imagina...
Represents an OpenCL kernel within ViennaCL.
Implementation of the dense matrix class.
Main kernel class for generating OpenCL kernels for the fast Fourier transform.
Manages an OpenCL context and provides the respective convenience functions for creating buffers...
result_of::size_type< viennacl::vector_base< T > >::type stride(viennacl::vector_base< T > const &s)
This file provides the forward declarations for the main types used within ViennaCL.
Determines row and column increments for matrices and matrix proxies.
void transpose(viennacl::matrix< NumericT, viennacl::row_major, AlignmentV > &input)
Inplace_transpose matrix.
viennacl::ocl::context const & context() const
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
vcl_size_t size(VectorType const &vec)
Generic routine for obtaining the size of a vector (ViennaCL, uBLAS, etc.)
A class representing local (shared) OpenCL memory. Typically used as kernel argument.
viennacl::ocl::kernel & get_kernel(std::string const &program_name, std::string const &kernel_name)
Convenience function for retrieving the kernel of a program directly from the context.
static void init(viennacl::ocl::context &ctx)
void radix2(viennacl::ocl::handle< cl_mem > const &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 algorithm for computing Fourier transformation.
void reverse(viennacl::vector_base< NumericT > &in)
Reverse vector to oposite order and save it in input vector.
void real_to_complex(viennacl::vector_base< NumericT > const &in, viennacl::vector_base< NumericT > &out, vcl_size_t size)
Create complex vector from real vector (even elements(2*k) = real part, odd elements(2*k+1) = imagina...
static std::string program_name()
void convolve_i(viennacl::vector< SCALARTYPE, ALIGNMENT > &input1, viennacl::vector< SCALARTYPE, ALIGNMENT > &input2, viennacl::vector< SCALARTYPE, ALIGNMENT > &output)
const vcl_size_t MAX_LOCAL_POINTS_NUM
void enqueue(KernelType &k, viennacl::ocl::command_queue const &queue)
Enqueues a kernel in the provided queue.
Representation of an OpenCL kernel in ViennaCL.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
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 size() const
Returns the length of the vector (cf. std::vector)
void direct(viennacl::ocl::handle< cl_mem > const &in, viennacl::ocl::handle< cl_mem > const &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 algorithm for computing Fourier transformation.
Implementations of Fast Furier Transformation using a plain single-threaded or OpenMP-enabled executi...
vcl_size_t num_bits(vcl_size_t size)
Get number of bits.
size_type internal_size2() const
Returns the internal number of columns. Usually required for launching OpenCL kernels only...
size_type internal_size1() const
Returns the internal number of rows. Usually required for launching OpenCL kernels only...
Extracts the underlying OpenCL handle from a vector, a matrix, an expression etc. ...
static void init(viennacl::ocl::context &ctx)
void normalize(viennacl::vector< NumericT, AlignmentV > &input)
Normalize vector on with his own size.
void bluestein(viennacl::vector< NumericT, AlignmentV > &in, viennacl::vector< NumericT, AlignmentV > &out, vcl_size_t)
Bluestein's algorithm for computing Fourier transformation.
Runtime generation of OpenCL kernels for matrix operations.
ScalarType fft(std::vector< ScalarType > &in, std::vector< ScalarType > &out, unsigned int, unsigned int, unsigned int batch_size)
SCALARTYPE sign(SCALARTYPE val)