Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Classes | Macros | Functions | Variables
fft.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
Include dependency graph for fft.c:

Classes

struct  GlobalMemory
 

Macros

#define SLAVESTART   1
 
#define PAGE_SIZE   4096
 
#define NUM_CACHE_LINES   65536
 
#define LOG2_LINE_SIZE   4
 
#define DEFAULT_M   4
 
#define DEFAULT_P   1
 
#define PI   3.1416
 
#define SHORT_BENCH
 
#define SWAP(a, b)   {double tmp; tmp=a; a=b; b=tmp;}
 

Functions

void SlaveStart ()
 
double TouchArray (double *, double *, double *, double *, int, int, int, int)
 
void FFT1D (int, int, int, double *, double *, double *, double *, int, int *, int, int, int, int, int, int, int, struct GlobalMemory *)
 
double CheckSum ()
 
double drand48 ()
 
int log_2 (int)
 
void printerr (char *)
 
void Transpose (int n1, double *src, double *dest, int MyNum, int MyFirst, int MyLast, int pad_length)
 
void FFT1DOnce (int direction, int M, int N, double *u, double *x)
 
void TwiddleOneCol (int direction, int n1, int N, int j, double *u, double *x, int pad_length)
 
void Scale (int n1, int N, double *x)
 
void SlaveStart (int my_id)
 
double CheckSum (int N, double *x)
 
void InitX (int N, double *x)
 
void InitU (int N, double *u)
 
void InitU2 (int N, double *u, int n1)
 
int BitReverse (int M, int k)
 
void FFT1D (int direction, int M, int N, double *x, double *scratch, double *upriv, double *umain2, MyNum, int *l_transtime, int MyFirst, int MyLast, int pad_length, int P, int test_result, int doprint, int dostats, struct GlobalMemory *Global)
 
void CopyColumn (int n1, double *src, double *dest)
 
void Reverse (int N, int M, double *x)
 
int main (int argc, char *argv)
 

Variables

struct GlobalMemoryGlobal
 
doublex
 
doubletrans
 
doubleumain
 
doubleumain2
 
int P = DEFAULT_P
 
int M = DEFAULT_M
 
int N
 
int rootN
 
int test_result = 0
 
int doprint = 1
 
int dostats = 0
 
int num_cache_lines = NUM_CACHE_LINES
 
int pad_length
 
int transtime = 0
 
int transtime2 = 0
 
int avgtranstime = 0
 
int avgcomptime = 0
 
unsigned int transstart = 0
 
unsigned int transend = 0
 
int maxtotal =0
 
int mintotal =0
 
double maxfrac =0
 
double minfrac =0
 
double avgfractime =0
 
int orig_num_lines = NUM_CACHE_LINES
 
int log2_line_size = LOG2_LINE_SIZE
 
int line_size
 
int rowsperproc
 
double ck1
 
double ck3
 

Macro Definition Documentation

#define DEFAULT_M   4
#define DEFAULT_P   1
#define LOG2_LINE_SIZE   4
#define NUM_CACHE_LINES   65536
#define PAGE_SIZE   4096

Referenced by main().

#define PI   3.1416

Referenced by InitU().

#define SHORT_BENCH
#define SLAVESTART   1
#define SWAP (   a,
 
)    {double tmp; tmp=a; a=b; b=tmp;}

Referenced by Reverse().

Function Documentation

int BitReverse ( int  M,
int  k 
)

References i, and M.

Referenced by Reverse().

double CheckSum ( )
double CheckSum ( int  N,
double x 
)

References i, pad_length, and rootN.

void CopyColumn ( int  n1,
double src,
double dest 
)

References i.

double drand48 ( )
void FFT1D ( int  ,
int  ,
int  ,
double ,
double ,
double ,
double ,
int  ,
int ,
int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
struct GlobalMemory  
)

Referenced by SlaveStart().

void FFT1D ( int  direction,
int  M,
int  N,
double x,
double scratch,
double upriv,
double umain2,
MyNum  ,
int l_transtime,
int  MyFirst,
int  MyLast,
int  pad_length,
int  P,
int  test_result,
int  doprint,
int  dostats,
struct GlobalMemory Global 
)

References FFT1DOnce(), Scale(), Transpose(), and TwiddleOneCol().

Here is the call graph for this function:

void FFT1DOnce ( int  direction,
int  M,
int  N,
double u,
double x 
)

References M, r, and Reverse().

Referenced by FFT1D().

Here is the call graph for this function:

void InitU ( int  N,
double u 
)

References core.waf.dependency::base(), N, and PI.

Referenced by main().

Here is the call graph for this function:

void InitU2 ( int  N,
double u,
int  n1 
)

References i, and pad_length.

Referenced by main().

void InitX ( int  N,
double x 
)

References i, pad_length, and rootN.

Referenced by main().

int log_2 ( int  number)
int main ( int  argc,
char argv 
)

References exit, InitU(), InitU2(), InitX(), line_size, log2_line_size, M, P, PAGE_SIZE, printerr(), rowsperproc, SlaveStart(), trans, umain2, and x.

Here is the call graph for this function:

void printerr ( char s)

Referenced by main().

void Reverse ( int  N,
int  M,
double x 
)

References BitReverse(), N, and SWAP.

Referenced by FFT1DOnce().

Here is the call graph for this function:

void Scale ( int  n1,
int  N,
double x 
)

References i, and N.

Referenced by FFT1D().

void SlaveStart ( )

Referenced by main().

void SlaveStart ( int  my_id)

References FFT1D(), i, P, and TouchArray().

Here is the call graph for this function:

double TouchArray ( double x,
double scratch,
double u,
double upriv,
int  N,
int  MyNum,
int  MyFirst,
int  MyLast 
)

References i, pad_length, and rootN.

Referenced by SlaveStart().

void Transpose ( int  n1,
double src,
double dest,
int  MyNum,
int  MyFirst,
int  MyLast,
int  pad_length 
)

References h, i, P, and pad_length.

Referenced by FFT1D().

void TwiddleOneCol ( int  direction,
int  n1,
int  N,
int  j,
double u,
double x,
int  pad_length 
)

References i, and pad_length.

Referenced by FFT1D().

Variable Documentation

int avgcomptime = 0
double avgfractime =0
int avgtranstime = 0
double ck1
double ck3
int doprint = 1
int dostats = 0
struct GlobalMemory* Global
int line_size

Referenced by main().

int log2_line_size = LOG2_LINE_SIZE

Referenced by main().

double maxfrac =0
int maxtotal =0
double minfrac =0
int mintotal =0
int N

Referenced by InitU(), Reverse(), and Scale().

int num_cache_lines = NUM_CACHE_LINES
int orig_num_lines = NUM_CACHE_LINES

Referenced by main(), SlaveStart(), and Transpose().

int pad_length
int rootN

Referenced by CheckSum(), InitX(), and TouchArray().

int rowsperproc

Referenced by main().

int test_result = 0
double* trans
unsigned int transend = 0
unsigned int transstart = 0
int transtime = 0
int transtime2 = 0
double* umain
double* umain2

Referenced by main().

double* x