ViennaCL - The Vienna Computing Library: viennacl/linalg/fft_operations.hpp Source File

ViennaCL - The Vienna Computing Library 1.7.1 Free open-source GPU-accelerated linear algebra and solver library. |

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fft_operations.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_LINALG_FFT_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_FFT_OPERATIONS_HPP_
3
4 /* =========================================================================
5 Copyright (c) 2010-2016, Institute for Microelectronics,
6 Institute for Analysis and Scientific Computing,
7 TU Wien.
8 Portions of this software are copyright by UChicago Argonne, LLC.
9
10 -----------------
11 ViennaCL - The Vienna Computing Library
12 -----------------
13
14 Project Head: Karl Rupp rupp@iue.tuwien.ac.at
15
16 (A list of authors and contributors can be found in the manual)
17
18 License: MIT (X11), see file LICENSE in the base directory
19 ============================================================================= */
20
25 #include <viennacl/vector.hpp>
26 #include <viennacl/matrix.hpp>
27
28 #include "viennacl/linalg/host_based/fft_operations.hpp"
29
30 #ifdef VIENNACL_WITH_OPENCL
31 #include "viennacl/linalg/opencl/fft_operations.hpp"
32 #include "viennacl/linalg/opencl/kernels/fft.hpp"
33 #endif
34
35 #ifdef VIENNACL_WITH_CUDA
36 #include "viennacl/linalg/cuda/fft_operations.hpp"
37 #endif
38
39 namespace viennacl
40 {
41 namespace linalg
42 {
43
50 template<typename NumericT, unsigned int AlignmentV>
51 void direct(viennacl::vector<NumericT, AlignmentV> const & in,
52 viennacl::vector<NumericT, AlignmentV> & out, vcl_size_t size, vcl_size_t stride,
53 vcl_size_t batch_num, NumericT sign = NumericT(-1),
54 viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::DATA_ORDER data_order = viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR)
55 {
56
57 switch (viennacl::traits::handle(in).get_active_handle_id())
58 {
59 case viennacl::MAIN_MEMORY:
60 viennacl::linalg::host_based::direct(in, out, size, stride, batch_num, sign, data_order);
61 break;
62 #ifdef VIENNACL_WITH_OPENCL
63 case viennacl::OPENCL_MEMORY:
64 viennacl::linalg::opencl::direct(viennacl::traits::opencl_handle(in), viennacl::traits::opencl_handle(out), size, stride, batch_num, sign,data_order);
65 break;
66 #endif
67
68 #ifdef VIENNACL_WITH_CUDA
69 case viennacl::CUDA_MEMORY:
70 viennacl::linalg::cuda::direct(in, out, size, stride, batch_num,sign,data_order);
71 break;
72 #endif
73
74 case viennacl::MEMORY_NOT_INITIALIZED:
75 throw memory_exception("not initialised!");
76 default:
77 throw memory_exception("not implemented");
78
79 }
80 }
81
88 template<typename NumericT, unsigned int AlignmentV>
89 void direct(viennacl::matrix<NumericT, viennacl::row_major, AlignmentV> const & in,
90 viennacl::matrix<NumericT, viennacl::row_major, AlignmentV>& out, vcl_size_t size,
91 vcl_size_t stride, vcl_size_t batch_num, NumericT sign = NumericT(-1),
92 viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::DATA_ORDER data_order = viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR)
93 {
94
95 switch (viennacl::traits::handle(in).get_active_handle_id())
96 {
97 case viennacl::MAIN_MEMORY:
98 viennacl::linalg::host_based::direct(in, out, size, stride, batch_num, sign, data_order);
99 break;
100 #ifdef VIENNACL_WITH_OPENCL
101 case viennacl::OPENCL_MEMORY:
102 viennacl::linalg::opencl::direct(viennacl::traits::opencl_handle(in), viennacl::traits::opencl_handle(out), size, stride, batch_num, sign,data_order);
103 break;
104 #endif
105
106 #ifdef VIENNACL_WITH_CUDA
107 case viennacl::CUDA_MEMORY:
108 viennacl::linalg::cuda::direct(in, out, size, stride, batch_num,sign,data_order);
109 break;
110 #endif
111
112 case viennacl::MEMORY_NOT_INITIALIZED:
113 throw memory_exception("not initialised!");
114 default:
115 throw memory_exception("not implemented");
116
117 }
118 }
119
120 /*
121 * This function performs reorder of input data. Indexes are sorted in bit-reversal order.
122 * Such reordering should be done before in-place FFT.
123 */
124 template<typename NumericT, unsigned int AlignmentV>
125 void reorder(viennacl::vector<NumericT, AlignmentV>& in, vcl_size_t size, vcl_size_t stride,
126 vcl_size_t bits_datasize, vcl_size_t batch_num,
127 viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::DATA_ORDER data_order = viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR)
128 {
129 switch (viennacl::traits::handle(in).get_active_handle_id())
130 {
131 case viennacl::MAIN_MEMORY:
132 viennacl::linalg::host_based::reorder(in, size, stride, bits_datasize, batch_num, data_order);
133 break;
134 #ifdef VIENNACL_WITH_OPENCL
135 case viennacl::OPENCL_MEMORY:
136 viennacl::linalg::opencl::reorder<NumericT>(viennacl::traits::opencl_handle(in), size, stride, bits_datasize, batch_num, data_order);
137 break;
138 #endif
139
140 #ifdef VIENNACL_WITH_CUDA
141 case viennacl::CUDA_MEMORY:
142 viennacl::linalg::cuda::reorder(in, size, stride, bits_datasize, batch_num, data_order);
143 break;
144 #endif
145
146 case viennacl::MEMORY_NOT_INITIALIZED:
147 throw memory_exception("not initialised!");
148 default:
149 throw memory_exception("not implemented");
150
151 }
152 }
153
161 template<typename NumericT, unsigned int AlignmentV>
162 void radix2(viennacl::matrix<NumericT, viennacl::row_major, AlignmentV> & in, vcl_size_t size,
163 vcl_size_t stride, vcl_size_t batch_num, NumericT sign = NumericT(-1),
164 viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::DATA_ORDER data_order = viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR)
165 {
166 switch (viennacl::traits::handle(in).get_active_handle_id())
167 {
168 case viennacl::MAIN_MEMORY:
169 viennacl::linalg::host_based::radix2(in, size, stride, batch_num, sign, data_order);
170 break;
171 #ifdef VIENNACL_WITH_OPENCL
172 case viennacl::OPENCL_MEMORY:
173 viennacl::linalg::opencl::radix2(viennacl::traits::opencl_handle(in), size, stride, batch_num, sign,data_order);
174 break;
175 #endif
176
177 #ifdef VIENNACL_WITH_CUDA
178 case viennacl::CUDA_MEMORY:
179 viennacl::linalg::cuda::radix2(in, size, stride, batch_num, sign, data_order);
180 break;
181 #endif
182
183 case viennacl::MEMORY_NOT_INITIALIZED:
184 throw memory_exception("not initialised!");
185 default:
186 throw memory_exception("not implemented");
187 }
188 }
189
197 template<typename NumericT, unsigned int AlignmentV>
198 void radix2(viennacl::vector<NumericT, AlignmentV>& in, vcl_size_t size, vcl_size_t stride,
199 vcl_size_t batch_num, NumericT sign = NumericT(-1),
200 viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::DATA_ORDER data_order = viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR)
201 {
202
203 switch (viennacl::traits::handle(in).get_active_handle_id())
204 {
205 case viennacl::MAIN_MEMORY:
206 viennacl::linalg::host_based::radix2(in, size, stride, batch_num, sign, data_order);
207 break;
208 #ifdef VIENNACL_WITH_OPENCL
209 case viennacl::OPENCL_MEMORY:
210 viennacl::linalg::opencl::radix2(viennacl::traits::opencl_handle(in), size, stride, batch_num, sign,data_order);
211 break;
212 #endif
213
214 #ifdef VIENNACL_WITH_CUDA
215 case viennacl::CUDA_MEMORY:
216 viennacl::linalg::cuda::radix2(in, size, stride, batch_num, sign,data_order);
217 break;
218 #endif
219
220 case viennacl::MEMORY_NOT_INITIALIZED:
221 throw memory_exception("not initialised!");
222 default:
223 throw memory_exception("not implemented");
224 }
225 }
226
234 template<typename NumericT, unsigned int AlignmentV>
235 void bluestein(viennacl::vector<NumericT, AlignmentV> & in,
236 viennacl::vector<NumericT, AlignmentV> & out, vcl_size_t /*batch_num*/)
237 {
238
239 switch (viennacl::traits::handle(in).get_active_handle_id())
240 {
241 case viennacl::MAIN_MEMORY:
242 viennacl::linalg::host_based::bluestein(in, out, 1);
243 break;
244 #ifdef VIENNACL_WITH_OPENCL
245 case viennacl::OPENCL_MEMORY:
246 viennacl::linalg::opencl::bluestein(in, out, 1);
247 break;
248 #endif
249
250 #ifdef VIENNACL_WITH_CUDA
251 case viennacl::CUDA_MEMORY:
252 viennacl::linalg::cuda::bluestein(in, out, 1);
253 break;
254 #endif
255
256 case viennacl::MEMORY_NOT_INITIALIZED:
257 throw memory_exception("not initialised!");
258 default:
259 throw memory_exception("not implemented");
260 }
261 }
262
266 template<typename NumericT, unsigned int AlignmentV>
267 void multiply_complex(viennacl::vector<NumericT, AlignmentV> const & input1,
268 viennacl::vector<NumericT, AlignmentV> const & input2,
269 viennacl::vector<NumericT, AlignmentV> & output)
270 {
271 switch (viennacl::traits::handle(input1).get_active_handle_id())
272 {
273 case viennacl::MAIN_MEMORY:
274 viennacl::linalg::host_based::multiply_complex(input1, input2, output);
275 break;
276 #ifdef VIENNACL_WITH_OPENCL
277 case viennacl::OPENCL_MEMORY:
278 viennacl::linalg::opencl::multiply_complex(input1, input2, output);
279 break;
280 #endif
281
282 #ifdef VIENNACL_WITH_CUDA
283 case viennacl::CUDA_MEMORY:
284 viennacl::linalg::cuda::multiply_complex(input1, input2, output);
285 break;
286 #endif
287
288 case viennacl::MEMORY_NOT_INITIALIZED:
289 throw memory_exception("not initialised!");
290 default:
291 throw memory_exception("not implemented");
292 }
293 }
294
298 template<typename NumericT, unsigned int AlignmentV>
299 void normalize(viennacl::vector<NumericT, AlignmentV> & input)
300 {
301 switch (viennacl::traits::handle(input).get_active_handle_id())
302 {
303 case viennacl::MAIN_MEMORY:
304 viennacl::linalg::host_based::normalize(input);
305 break;
306 #ifdef VIENNACL_WITH_OPENCL
307 case viennacl::OPENCL_MEMORY:
308 viennacl::linalg::opencl::normalize(input);
309 break;
310 #endif
311
312 #ifdef VIENNACL_WITH_CUDA
313 case viennacl::CUDA_MEMORY:
314 viennacl::linalg::cuda::normalize(input);
315 break;
316 #endif
317
318 case viennacl::MEMORY_NOT_INITIALIZED:
319 throw memory_exception("not initialised!");
320 default:
321 throw memory_exception("not implemented");
322 }
323 }
324
328 template<typename NumericT, unsigned int AlignmentV>
329 void transpose(viennacl::matrix<NumericT, viennacl::row_major, AlignmentV> & input)
330 {
331 switch (viennacl::traits::handle(input).get_active_handle_id())
332 {
333 case viennacl::MAIN_MEMORY:
334 viennacl::linalg::host_based::transpose(input);
335 break;
336 #ifdef VIENNACL_WITH_OPENCL
337 case viennacl::OPENCL_MEMORY:
338 viennacl::linalg::opencl::transpose(input);
339 break;
340 #endif
341
342 #ifdef VIENNACL_WITH_CUDA
343 case viennacl::CUDA_MEMORY:
344 viennacl::linalg::cuda::transpose(input);
345 break;
346 #endif
347
348 case viennacl::MEMORY_NOT_INITIALIZED:
349 throw memory_exception("not initialised!");
350 default:
351 throw memory_exception("not implemented");
352 }
353 }
354
358 template<typename NumericT, unsigned int AlignmentV>
359 void transpose(viennacl::matrix<NumericT, viennacl::row_major, AlignmentV> const & input,
360 viennacl::matrix<NumericT, viennacl::row_major, AlignmentV> & output)
361 {
362 switch (viennacl::traits::handle(input).get_active_handle_id())
363 {
364 case viennacl::MAIN_MEMORY:
365 viennacl::linalg::host_based::transpose(input, output);
366 break;
367 #ifdef VIENNACL_WITH_OPENCL
368 case viennacl::OPENCL_MEMORY:
369 viennacl::linalg::opencl::transpose(input, output);
370 break;
371 #endif
372
373 #ifdef VIENNACL_WITH_CUDA
374 case viennacl::CUDA_MEMORY:
375 viennacl::linalg::cuda::transpose(input, output);
376 break;
377 #endif
378
379 case viennacl::MEMORY_NOT_INITIALIZED:
380 throw memory_exception("not initialised!");
381 default:
382 throw memory_exception("not implemented");
383 }
384 }
385
389 template<typename NumericT>
390 void real_to_complex(viennacl::vector_base<NumericT> const & in,
391 viennacl::vector_base<NumericT> & out, vcl_size_t size)
392 {
393 switch (viennacl::traits::handle(in).get_active_handle_id())
394 {
395 case viennacl::MAIN_MEMORY:
396 viennacl::linalg::host_based::real_to_complex(in, out, size);
397 break;
398 #ifdef VIENNACL_WITH_OPENCL
399 case viennacl::OPENCL_MEMORY:
400 viennacl::linalg::opencl::real_to_complex(in,out,size);
401 break;
402 #endif
403
404 #ifdef VIENNACL_WITH_CUDA
405 case viennacl::CUDA_MEMORY:
406 viennacl::linalg::cuda::real_to_complex(in,out,size);
407 break;
408 #endif
409
410 case viennacl::MEMORY_NOT_INITIALIZED:
411 throw memory_exception("not initialised!");
412 default:
413 throw memory_exception("not implemented");
414 }
415 }
416
420 template<typename NumericT>
421 void complex_to_real(viennacl::vector_base<NumericT> const & in,
422 viennacl::vector_base<NumericT> & out, vcl_size_t size)
423 {
424 switch (viennacl::traits::handle(in).get_active_handle_id())
425 {
426 case viennacl::MAIN_MEMORY:
427 viennacl::linalg::host_based::complex_to_real(in, out, size);
428 break;
429 #ifdef VIENNACL_WITH_OPENCL
430 case viennacl::OPENCL_MEMORY:
431 viennacl::linalg::opencl::complex_to_real(in, out, size);
432 break;
433 #endif
434
435 #ifdef VIENNACL_WITH_CUDA
436 case viennacl::CUDA_MEMORY:
437 viennacl::linalg::cuda::complex_to_real(in, out, size);
438 break;
439 #endif
440
441 case viennacl::MEMORY_NOT_INITIALIZED:
442 throw memory_exception("not initialised!");
443 default:
444 throw memory_exception("not implemented");
445 }
446 }
447
451 template<typename NumericT>
452 void reverse(viennacl::vector_base<NumericT> & in)
453 {
454 switch (viennacl::traits::handle(in).get_active_handle_id())
455 {
456 case viennacl::MAIN_MEMORY:
457 viennacl::linalg::host_based::reverse(in);
458 break;
459 #ifdef VIENNACL_WITH_OPENCL
460 case viennacl::OPENCL_MEMORY:
461 viennacl::linalg::opencl::reverse(in);
462 break;
463 #endif
464
465 #ifdef VIENNACL_WITH_CUDA
466 case viennacl::CUDA_MEMORY:
467 viennacl::linalg::cuda::reverse(in);
468 break;
469 #endif
470
471 case viennacl::MEMORY_NOT_INITIALIZED:
472 throw memory_exception("not initialised!");
473 default:
474 throw memory_exception("not implemented");
475 }
476 }
477
478 }
479 }
480
481 #endif /* FFT_OPERATIONS_HPP_ */
fft.hpp
OpenCL kernel file for FFT operations.
fft_operations.hpp
Implementations of Fast Furier Transformation using OpenCL.
viennacl::memory_exception
Exception class in case of memory errors.
Definition: forwards.h:572
viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::DATA_ORDER
DATA_ORDER
Definition: fft_operations.hpp:49
viennacl::linalg::opencl::complex_to_real
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...
Definition: fft_operations.hpp:320
matrix.hpp
Implementation of the dense matrix class.
viennacl::linalg::cuda::real_to_complex
__global__ void real_to_complex(const RealT *in, ComplexT *out, unsigned int size)
Definition: fft_operations.hpp:782
viennacl::linalg::reorder
void reorder(viennacl::vector< NumericT, AlignmentV > &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)
Definition: fft_operations.hpp:125
viennacl::linalg::real_to_complex
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...
Definition: fft_operations.hpp:390
viennacl::linalg::complex_to_real
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...
Definition: fft_operations.hpp:421
viennacl::linalg::reverse
void reverse(viennacl::vector_base< NumericT > &in)
Reverse vector to oposite order and save it in input vector.
Definition: fft_operations.hpp:452
viennacl::OPENCL_MEMORY
Definition: forwards.h:349
viennacl::linalg::host_based::reverse
void reverse(viennacl::vector_base< NumericT > &in)
Reverse vector to opposite order and save it in input vector.
Definition: fft_operations.hpp:835
viennacl::linalg::host_based::radix2
void radix2(viennacl::vector< NumericT, 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.
Definition: fft_operations.hpp:525
viennacl::traits::stride
result_of::size_type< viennacl::vector_base< T > >::type stride(viennacl::vector_base< T > const &s)
Definition: stride.hpp:45
viennacl::matrix
A dense matrix class.
Definition: forwards.h:375
viennacl::linalg::opencl::transpose
void transpose(viennacl::matrix< NumericT, viennacl::row_major, AlignmentV > &input)
Inplace_transpose matrix.
Definition: fft_operations.hpp:277
viennacl::linalg::bluestein
void bluestein(viennacl::vector< NumericT, AlignmentV > &in, viennacl::vector< NumericT, AlignmentV > &out, vcl_size_t)
Bluestein's algorithm for computing Fourier transformation.
Definition: fft_operations.hpp:235
viennacl::linalg::normalize
void normalize(viennacl::vector< NumericT, AlignmentV > &input)
Normalize vector on with his own size.
Definition: fft_operations.hpp:299
NumericT
float NumericT
Definition: bisect.cpp:40
viennacl::linalg::cuda::transpose
__global__ void transpose(const NumericT *input, NumericT *output, unsigned int row_num, unsigned int col_num)
Definition: fft_operations.hpp:713
viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR
Definition: fft_operations.hpp:51
viennacl::traits::size
vcl_size_t size(VectorType const &vec)
Generic routine for obtaining the size of a vector (ViennaCL, uBLAS, etc.)
Definition: size.hpp:239
viennacl::linalg::cuda::radix2
void radix2(viennacl::vector< NumericT, 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.
Definition: fft_operations.hpp:442
viennacl::linalg::host_based::real_to_complex
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...
Definition: fft_operations.hpp:797
viennacl::linalg::cuda::bluestein
void bluestein(viennacl::vector< NumericT, AlignmentV > &in, viennacl::vector< NumericT, AlignmentV > &out, vcl_size_t)
Bluestein's algorithm for computing Fourier transformation.
Definition: fft_operations.hpp:622
viennacl::MEMORY_NOT_INITIALIZED
Definition: forwards.h:347
viennacl::CUDA_MEMORY
Definition: forwards.h:350
viennacl::linalg::host_based::multiply_complex
void multiply_complex(viennacl::vector< NumericT, AlignmentV > const &input1, viennacl::vector< NumericT, AlignmentV > const &input2, viennacl::vector< NumericT, AlignmentV > &output)
Complex multiplikation of two vectors.
Definition: fft_operations.hpp:697
viennacl::vector_base< NumericT >
viennacl::linalg::opencl::radix2
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.
Definition: fft_operations.hpp:161
viennacl::linalg::multiply_complex
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.
Definition: fft_operations.hpp:267
viennacl::linalg::opencl::reverse
void reverse(viennacl::vector_base< NumericT > &in)
Reverse vector to oposite order and save it in input vector.
Definition: fft_operations.hpp:334
viennacl::linalg::opencl::real_to_complex
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...
Definition: fft_operations.hpp:306
viennacl::vcl_size_t
std::size_t vcl_size_t
Definition: forwards.h:75
viennacl::vector< NumericT, AlignmentV >
viennacl::linalg::host_based::bluestein
void bluestein(viennacl::vector< NumericT, AlignmentV > &in, viennacl::vector< NumericT, AlignmentV > &out, vcl_size_t)
Bluestein's algorithm for computing Fourier transformation.
Definition: fft_operations.hpp:599
viennacl::linalg::host_based::direct
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.
Definition: fft_operations.hpp:251
viennacl::linalg::cuda::normalize
void normalize(viennacl::vector< NumericT, AlignmentV > &input)
Normalize vector on with his own size.
Definition: fft_operations.hpp:700
viennacl::linalg::radix2
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.
Definition: fft_operations.hpp:162
viennacl::MAIN_MEMORY
Definition: forwards.h:348
viennacl::linalg::host_based::transpose
void transpose(viennacl::matrix< NumericT, viennacl::row_major, AlignmentV > &input)
Inplace transpose of matrix.
Definition: fft_operations.hpp:727
viennacl::linalg::transpose
void transpose(viennacl::matrix< NumericT, viennacl::row_major, AlignmentV > &input)
Inplace_transpose matrix.
Definition: fft_operations.hpp:329
vector.hpp
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
viennacl::linalg::opencl::multiply_complex
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.
Definition: fft_operations.hpp:246
fft_operations.hpp
Implementations of Fast Furier Transformation using cuda.
viennacl::linalg::opencl::direct
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.
Definition: fft_operations.hpp:99
fft_operations.hpp
Implementations of Fast Furier Transformation using a plain single-threaded or OpenMP-enabled executi...
viennacl::linalg::cuda::reverse
void reverse(viennacl::vector_base< NumericT > &in)
Reverse vector to oposite order and save it in input vector.
Definition: fft_operations.hpp:847
viennacl::linalg::host_based::normalize
void normalize(viennacl::vector< NumericT, AlignmentV > &input)
Normalize vector with his own size.
Definition: fft_operations.hpp:684
viennacl::linalg::cuda::multiply_complex
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.
Definition: fft_operations.hpp:674
viennacl::linalg::cuda::complex_to_real
__global__ void complex_to_real(const ComplexT *in, RealT *out, unsigned int size)
Definition: fft_operations.hpp:809
viennacl::traits::handle
viennacl::backend::mem_handle & handle(T &obj)
Returns the generic memory handle of an object. Non-const version.
Definition: handle.hpp:41
viennacl::linalg::cuda::reorder
void reorder(viennacl::vector< NumericT, AlignmentV > &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)
Definition: fft_operations.hpp:282
viennacl::linalg::cuda::direct
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.
Definition: fft_operations.hpp:197
viennacl::linalg::host_based::complex_to_real
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...
Definition: fft_operations.hpp:818
viennacl::linalg::direct
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.
Definition: fft_operations.hpp:51
viennacl::linalg::host_based::reorder
void reorder(viennacl::vector< NumericT, AlignmentV > &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)
Definition: fft_operations.hpp:302
viennacl::linalg::opencl::normalize
void normalize(viennacl::vector< NumericT, AlignmentV > &input)
Normalize vector on with his own size.
Definition: fft_operations.hpp:261
viennacl::linalg::opencl::bluestein
void bluestein(viennacl::vector< NumericT, AlignmentV > &in, viennacl::vector< NumericT, AlignmentV > &out, vcl_size_t)
Bluestein's algorithm for computing Fourier transformation.
Definition: fft_operations.hpp:212
viennacl::linalg::detail::sign
SCALARTYPE sign(SCALARTYPE val)
Definition: qr-method-common.hpp:71