Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

fftw_setup.c

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include "fftw.h"
00003 #include "mrilib.h"
00004 
00005 /*** write some FFTW wisdom ***/
00006 
00007 int main( int argc , char * argv[] )
00008 {
00009    fftw_plan p ;
00010    char fname[1024]="\0" , *w ;
00011    int ii , len[] = { 1024 , 3600 , 784 , 2000 , 864 , 0 } ;
00012    double cpu_old , cpu_new ;
00013 
00014    cpu_old = COX_cpu_time() ;
00015    for( ii=0 ; len[ii] > 1 ; ii++ ){
00016       fprintf(stderr,"FFTW calibrating N=%5d",len[ii]) ; fflush(stdout) ;
00017       p = fftw_create_plan(len[ii], FFTW_FORWARD , FFTW_MEASURE|FFTW_USE_WISDOM);
00018       fftw_destroy_plan(p) ;
00019       fprintf(stderr,".") ; fflush(stdout) ;
00020       p = fftw_create_plan(len[ii], FFTW_BACKWARD, FFTW_MEASURE|FFTW_USE_WISDOM);
00021       fftw_destroy_plan(p) ;
00022       fprintf(stderr,".") ; fflush(stdout) ;
00023       cpu_new = COX_cpu_time() ;
00024       fprintf(stderr," %.2f CPU s\n",cpu_new-cpu_old) ; cpu_old = cpu_new ;
00025    }
00026 
00027    w = fftw_export_wisdom_to_string() ;
00028    printf("%s\n",w) ;
00029    fftw_free(w) ;
00030    exit(0) ;
00031 }
 

Powered by Plone

This site conforms to the following standards: