00001 #ifndef _fftwlink_h
00002 #define _fftwlink_h
00003
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00056 #include "fftw3.h"
00057
00058 #ifdef __cplusplus
00059 extern "C" {
00060 #endif
00061
00062 #define FFTW_MANGLE_DOUBLE_PROC(name) ( FFTW_CONCAT(*_fftw_, name) )
00063 #define FFTW_MANGLE_FLOAT_PROC(name) ( FFTW_CONCAT(*_fftwf_, name) )
00064 #define FFTW_MANGLE_LONG_DOUBLE_PROC(name) ( FFTW_CONCAT(*_fftwl_, name) )
00065
00066 #define FFTW_MANGLE_DOUBLE_DATA(name) FFTW_CONCAT(_fftw_, name)
00067 #define FFTW_MANGLE_FLOAT_DATA(name) FFTW_CONCAT(_fftwf_, name)
00068 #define FFTW_MANGLE_LONG_DOUBLE_DATA(name) FFTW_CONCAT(_fftwl_, name)
00069
00070
00071 #define FFTW_DEFINE_API_LINK(P,D,X,R,C)\
00072 EX void P(execute)(const X(plan) p);\
00073 EX X(plan) P(plan_dft)(int rank, const int *n,\
00074 C *in, C *out, int sign, unsigned flags);\
00075 EX X(plan) P(plan_dft_1d)(int n, C *in, C *out, int sign,\
00076 unsigned flags);\
00077 EX X(plan) P(plan_dft_2d)(int nx, int ny,\
00078 C *in, C *out, int sign, unsigned flags);\
00079 EX X(plan) P(plan_dft_3d)(int nx, int ny, int nz,\
00080 C *in, C *out, int sign, unsigned flags);\
00081 EX X(plan) P(plan_many_dft)(int rank, const int *n,\
00082 int howmany,\
00083 C *in, const int *inembed,\
00084 int istride, int idist,\
00085 C *out, const int *onembed,\
00086 int ostride, int odist,\
00087 int sign, unsigned flags);\
00088 EX X(plan) P(plan_guru_dft)(int rank, const X(iodim) *dims,\
00089 int howmany_rank,\
00090 const X(iodim) *howmany_dims,\
00091 C *in, C *out,\
00092 int sign, unsigned flags);\
00093 EX X(plan) P(plan_guru_split_dft)(int rank, const X(iodim) *dims,\
00094 int howmany_rank,\
00095 const X(iodim) *howmany_dims,\
00096 R *ri, R *ii, R *ro, R *io,\
00097 unsigned flags);\
00098 EX void P(execute_dft)(const X(plan) p, C *in, C *out);\
00099 EX void P(execute_split_dft)(const X(plan) p, R *ri, R *ii, R *ro, R *io);\
00100 EX X(plan) P(plan_many_dft_r2c)(int rank, const int *n,\
00101 int howmany,\
00102 R *in, const int *inembed,\
00103 int istride, int idist,\
00104 C *out, const int *onembed,\
00105 int ostride, int odist,\
00106 unsigned flags);\
00107 EX X(plan) P(plan_dft_r2c)(int rank, const int *n,\
00108 R *in, C *out, unsigned flags);\
00109 EX X(plan) P(plan_dft_r2c_1d)(int n,R *in,C *out,unsigned flags);\
00110 EX X(plan) P(plan_dft_r2c_2d)(int nx, int ny,\
00111 R *in, C *out, unsigned flags);\
00112 EX X(plan) P(plan_dft_r2c_3d)(int nx, int ny,\
00113 int nz,\
00114 R *in, C *out, unsigned flags);\
00115 EX X(plan) P(plan_many_dft_c2r)(int rank, const int *n,\
00116 int howmany,\
00117 C *in, const int *inembed,\
00118 int istride, int idist,\
00119 R *out, const int *onembed,\
00120 int ostride, int odist,\
00121 unsigned flags);\
00122 EX X(plan) P(plan_dft_c2r)(int rank, const int *n,\
00123 C *in, R *out, unsigned flags);\
00124 EX X(plan) P(plan_dft_c2r_1d)(int n,C *in,R *out,unsigned flags);\
00125 EX X(plan) P(plan_dft_c2r_2d)(int nx, int ny,\
00126 C *in, R *out, unsigned flags);\
00127 EX X(plan) P(plan_dft_c2r_3d)(int nx, int ny,\
00128 int nz,\
00129 C *in, R *out, unsigned flags);\
00130 EX X(plan) P(plan_guru_dft_r2c)(int rank, const X(iodim) *dims,\
00131 int howmany_rank,\
00132 const X(iodim) *howmany_dims,\
00133 R *in, C *out,\
00134 unsigned flags); \
00135 EX X(plan) P(plan_guru_dft_c2r)(int rank, const X(iodim) *dims,\
00136 int howmany_rank,\
00137 const X(iodim) *howmany_dims,\
00138 C *in, R *out,\
00139 unsigned flags);\
00140 EX X(plan) P(plan_guru_split_dft_r2c)(int rank, const X(iodim) *dims,\
00141 int howmany_rank,\
00142 const X(iodim) *howmany_dims,\
00143 R *in, R *ro, R *io,\
00144 unsigned flags);\
00145 EX X(plan) P(plan_guru_split_dft_c2r)(int rank, const X(iodim) *dims,\
00146 int howmany_rank,\
00147 const X(iodim) *howmany_dims,\
00148 R *ri, R *ii, R *out,\
00149 unsigned flags);\
00150 EX void P(execute_dft_r2c)(const X(plan) p, R *in, C *out);\
00151 EX void P(execute_dft_c2r)(const X(plan) p, C *in, R *out);\
00152 EX void P(execute_split_dft_r2c)(const X(plan) p, R *in, R *ro, R *io);\
00153 EX void P(execute_split_dft_c2r)(const X(plan) p, R *ri, R *ii, R *out);\
00154 EX X(plan) P(plan_many_r2r)(int rank, const int *n,\
00155 int howmany,\
00156 R *in, const int *inembed,\
00157 int istride, int idist,\
00158 R *out, const int *onembed,\
00159 int ostride, int odist,\
00160 const X(r2r_kind) *kind, unsigned flags);\
00161 EX X(plan) P(plan_r2r)(int rank, const int *n, R *in, R *out,\
00162 const X(r2r_kind) *kind, unsigned flags);\
00163 EX X(plan) P(plan_r2r_1d)(int n, R *in, R *out,\
00164 X(r2r_kind) kind, unsigned flags);\
00165 EX X(plan) P(plan_r2r_2d)(int nx, int ny, R *in, R *out,\
00166 X(r2r_kind) kindx, X(r2r_kind) kindy,\
00167 unsigned flags);\
00168 EX X(plan) P(plan_r2r_3d)(int nx, int ny, int nz,\
00169 R *in, R *out, X(r2r_kind) kindx,\
00170 X(r2r_kind) kindy, X(r2r_kind) kindz,\
00171 unsigned flags);\
00172 EX X(plan) P(plan_guru_r2r)(int rank, const X(iodim) *dims,\
00173 int howmany_rank,\
00174 const X(iodim) *howmany_dims,\
00175 R *in, R *out, \
00176 const X(r2r_kind) *kind, unsigned flags);\
00177 EX void P(execute_r2r)(const X(plan) p, R *in, R *out);\
00178 EX void P(destroy_plan)(X(plan) p);\
00179 EX void P(forget_wisdom)(void);\
00180 EX void P(cleanup)(void);\
00181 EX void P(plan_with_nthreads)(int nthreads);\
00182 EX int P(init_threads)(void);\
00183 EX void P(cleanup_threads)(void);\
00184 EX void P(export_wisdom_to_file)(FILE *output_file);\
00185 EX char *P(export_wisdom_to_string)(void);\
00186 EX void P(export_wisdom)(void (*write_char)(char c, void *), void *data);\
00187 EX int P(import_system_wisdom)(void);\
00188 EX int P(import_wisdom_from_file)(FILE *input_file);\
00189 EX int P(import_wisdom_from_string)(const char *input_string);\
00190 EX int P(import_wisdom)(int (*read_char)(void *), void *data);\
00191 EX void P(fprint_plan)(const X(plan) p, FILE *output_file);\
00192 EX void P(print_plan)(const X(plan) p);\
00193 EX void *P(malloc)(size_t n);\
00194 EX void P(free)(void *p);\
00195 EX void P(flops)(const X(plan) p, double *add, double *mul, double *fma);\
00196 EX const char* D(version);\
00197 EX const char* D(cc);\
00198 EX const char* D(codelet_optim);
00199
00200
00201 #define PROC_PTR(a) (* _##a)
00202 #define DATA_PTR(a) *_##X(a)
00203
00204
00205 #define EX extern
00206 FFTW_DEFINE_API_LINK(FFTW_MANGLE_DOUBLE_PROC, FFTW_MANGLE_DOUBLE_DATA, FFTW_MANGLE_DOUBLE, double, fftw_complex)
00207 FFTW_DEFINE_API_LINK(FFTW_MANGLE_FLOAT_PROC, FFTW_MANGLE_FLOAT_DATA, FFTW_MANGLE_FLOAT, float, fftwf_complex)
00208 #undef EX
00209 #define EX
00210
00234 int _fftw_link_api(TCHAR* dll_path, unsigned flags);
00235
00250 void _fftw_unlink_api(unsigned flags);
00251
00252 #define FFTW_LINK_FLOAT (0x1)
00253 #define FFTW_LINK_DOUBLE (0x2)
00254 #define FFTW_NO_SSE (0x80000000)
00255 #define FFTW_NO_SSE2 (0x40000000)
00256
00257 #ifdef __cplusplus
00258 }
00259 #endif
00260
00261 #endif