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_2d.cpp File Reference
#include <iostream>
#include <vector>
#include <cmath>
#include <complex>
#include <algorithm>
#include "viennacl/linalg/host_based/fft_operations.hpp"
#include "viennacl/linalg/fft_operations.hpp"
#include "viennacl/fft.hpp"

Go to the source code of this file.

Classes

struct  testData
 

Typedefs

typedef float ScalarType
 
typedef ScalarType(* test_function_ptr )(std::vector< ScalarType > &, std::vector< ScalarType > &, unsigned int, unsigned int, unsigned int)
 
typedef void(* input_function_ptr )(std::vector< ScalarType > &, std::vector< ScalarType > &, unsigned int &, unsigned int &, unsigned int &, const std::string &)
 

Functions

void set_values_struct (std::vector< ScalarType > &input, std::vector< ScalarType > &output, unsigned int &rows, unsigned int &cols, unsigned int &batch_size, testData &data)
 
void read_matrices_pair (std::vector< ScalarType > &input, std::vector< ScalarType > &output, unsigned int &rows, unsigned int &cols, unsigned int &batch_size, const std::string &log_tag)
 
template<typename ScalarType >
ScalarType diff (std::vector< ScalarType > &vec, std::vector< ScalarType > &ref)
 
template<typename ScalarType >
ScalarType diff_max (std::vector< ScalarType > &vec, std::vector< ScalarType > &ref)
 
void copy_vector_to_matrix (viennacl::matrix< ScalarType > &input, std::vector< ScalarType > &in, unsigned int row, unsigned int col)
 
void copy_matrix_to_vector (viennacl::matrix< ScalarType > &input, std::vector< ScalarType > &in, unsigned int row, unsigned int col)
 
ScalarType fft_2d_1arg (std::vector< ScalarType > &in, std::vector< ScalarType > &out, unsigned int row, unsigned int col, unsigned int)
 
ScalarType transpose_inplace (std::vector< ScalarType > &in, std::vector< ScalarType > &out, unsigned int row, unsigned int col, unsigned int)
 
ScalarType transpose (std::vector< ScalarType > &in, std::vector< ScalarType > &out, unsigned int row, unsigned int col, unsigned int)
 
ScalarType fft_2d_2arg (std::vector< ScalarType > &in, std::vector< ScalarType > &out, unsigned int row, unsigned int col, unsigned int)
 
int test_correctness (const std::string &log_tag, input_function_ptr input_function, test_function_ptr func)
 
int main ()
 

Variables

const ScalarType EPS = ScalarType(0.06f)
 

Detailed Description

Tests the two-dimensional FFT routines.

Test:
Tests the two-dimensional FFT routines.

Definition in file fft_2d.cpp.

Typedef Documentation

typedef void(* input_function_ptr)(std::vector< ScalarType > &, std::vector< ScalarType > &, unsigned int &, unsigned int &, unsigned int &, const std::string &)

Definition at line 48 of file fft_2d.cpp.

typedef float ScalarType

Definition at line 42 of file fft_2d.cpp.

typedef ScalarType(* test_function_ptr)(std::vector< ScalarType > &, std::vector< ScalarType > &, unsigned int, unsigned int, unsigned int)

Definition at line 46 of file fft_2d.cpp.

Function Documentation

void copy_matrix_to_vector ( viennacl::matrix< ScalarType > &  input,
std::vector< ScalarType > &  in,
unsigned int  row,
unsigned int  col 
)

Definition at line 184 of file fft_2d.cpp.

void copy_vector_to_matrix ( viennacl::matrix< ScalarType > &  input,
std::vector< ScalarType > &  in,
unsigned int  row,
unsigned int  col 
)

Definition at line 170 of file fft_2d.cpp.

template<typename ScalarType >
ScalarType diff ( std::vector< ScalarType > &  vec,
std::vector< ScalarType > &  ref 
)

Definition at line 130 of file fft_2d.cpp.

template<typename ScalarType >
ScalarType diff_max ( std::vector< ScalarType > &  vec,
std::vector< ScalarType > &  ref 
)

Definition at line 145 of file fft_2d.cpp.

ScalarType fft_2d_1arg ( std::vector< ScalarType > &  in,
std::vector< ScalarType > &  out,
unsigned int  row,
unsigned int  col,
unsigned  int 
)

Definition at line 197 of file fft_2d.cpp.

ScalarType fft_2d_2arg ( std::vector< ScalarType > &  in,
std::vector< ScalarType > &  out,
unsigned int  row,
unsigned int  col,
unsigned  int 
)

Definition at line 263 of file fft_2d.cpp.

int main ( )

Definition at line 311 of file fft_2d.cpp.

void read_matrices_pair ( std::vector< ScalarType > &  input,
std::vector< ScalarType > &  output,
unsigned int &  rows,
unsigned int &  cols,
unsigned int &  batch_size,
const std::string &  log_tag 
)

Definition at line 115 of file fft_2d.cpp.

void set_values_struct ( std::vector< ScalarType > &  input,
std::vector< ScalarType > &  output,
unsigned int &  rows,
unsigned int &  cols,
unsigned int &  batch_size,
testData data 
)

Definition at line 95 of file fft_2d.cpp.

int test_correctness ( const std::string &  log_tag,
input_function_ptr  input_function,
test_function_ptr  func 
)

Definition at line 286 of file fft_2d.cpp.

ScalarType transpose ( std::vector< ScalarType > &  in,
std::vector< ScalarType > &  out,
unsigned int  row,
unsigned int  col,
unsigned  int 
)

Definition at line 239 of file fft_2d.cpp.

ScalarType transpose_inplace ( std::vector< ScalarType > &  in,
std::vector< ScalarType > &  out,
unsigned int  row,
unsigned int  col,
unsigned  int 
)

Definition at line 218 of file fft_2d.cpp.

Variable Documentation

const ScalarType EPS = ScalarType(0.06f)

Definition at line 44 of file fft_2d.cpp.