cannam@127: /* cannam@127: * Copyright (c) 2003, 2007-14 Matteo Frigo cannam@127: * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology cannam@127: * cannam@127: * This program is free software; you can redistribute it and/or modify cannam@127: * it under the terms of the GNU General Public License as published by cannam@127: * the Free Software Foundation; either version 2 of the License, or cannam@127: * (at your option) any later version. cannam@127: * cannam@127: * This program is distributed in the hope that it will be useful, cannam@127: * but WITHOUT ANY WARRANTY; without even the implied warranty of cannam@127: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the cannam@127: * GNU General Public License for more details. cannam@127: * cannam@127: * You should have received a copy of the GNU General Public License cannam@127: * along with this program; if not, write to the Free Software cannam@127: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA cannam@127: * cannam@127: */ cannam@127: cannam@127: /* internal API definitions */ cannam@127: #ifndef __API_H__ cannam@127: #define __API_H__ cannam@127: cannam@127: #ifndef CALLING_FFTW /* defined in hook.c, when calling internal functions */ cannam@127: # define COMPILING_FFTW /* used for DLL symbol exporting in fftw3.h */ cannam@127: #endif cannam@127: cannam@127: /* When compiling with GNU libtool on Windows, DLL_EXPORT is #defined cannam@127: for compiling the shared-library code. In this case, we'll #define cannam@127: FFTW_DLL to add dllexport attributes to the specified functions in cannam@127: fftw3.h. cannam@127: cannam@127: If we don't specify dllexport explicitly, then libtool cannam@127: automatically exports all symbols. However, if we specify cannam@127: dllexport explicitly for any functions, then libtool apparently cannam@127: doesn't do any automatic exporting. (Not documented, grrr, but cannam@127: this is the observed behavior with libtool 1.5.8.) Thus, using cannam@127: this forces us to correctly dllexport every exported symbol, or cannam@127: linking bench.exe will fail. This has the advantage of forcing cannam@127: us to mark things correctly, which is necessary for other compilers cannam@127: (such as MS VC++). */ cannam@127: #ifdef DLL_EXPORT cannam@127: # define FFTW_DLL cannam@127: #endif cannam@127: cannam@127: /* just in case: force not to use C99 complex numbers cannam@127: (we need this for IBM xlc because _Complex_I is treated specially cannam@127: and is defined even if is not included) */ cannam@127: #define FFTW_NO_Complex cannam@127: cannam@127: #include "fftw3.h" cannam@127: #include "ifftw.h" cannam@127: #include "rdft.h" cannam@127: cannam@127: #ifdef __cplusplus cannam@127: extern "C" cannam@127: { cannam@127: #endif /* __cplusplus */ cannam@127: cannam@127: /* the API ``plan'' contains both the kernel plan and problem */ cannam@127: struct X(plan_s) { cannam@127: plan *pln; cannam@127: problem *prb; cannam@127: int sign; cannam@127: }; cannam@127: cannam@127: /* shorthand */ cannam@127: typedef struct X(plan_s) apiplan; cannam@127: cannam@127: /* complex type for internal use */ cannam@127: typedef R C[2]; cannam@127: cannam@127: #define EXTRACT_REIM(sign, c, r, i) X(extract_reim)(sign, (c)[0], r, i) cannam@127: cannam@127: #define TAINT_UNALIGNED(p, flg) TAINT(p, ((flg) & FFTW_UNALIGNED) != 0) cannam@127: cannam@127: tensor *X(mktensor_rowmajor)(int rnk, const int *n, cannam@127: const int *niphys, const int *nophys, cannam@127: int is, int os); cannam@127: cannam@127: tensor *X(mktensor_iodims)(int rank, const X(iodim) *dims, int is, int os); cannam@127: tensor *X(mktensor_iodims64)(int rank, const X(iodim64) *dims, int is, int os); cannam@127: const int *X(rdft2_pad)(int rnk, const int *n, const int *nembed, cannam@127: int inplace, int cmplx, int **nfree); cannam@127: cannam@127: int X(many_kosherp)(int rnk, const int *n, int howmany); cannam@127: int X(guru_kosherp)(int rank, const X(iodim) *dims, cannam@127: int howmany_rank, const X(iodim) *howmany_dims); cannam@127: int X(guru64_kosherp)(int rank, const X(iodim64) *dims, cannam@127: int howmany_rank, const X(iodim64) *howmany_dims); cannam@127: cannam@127: /* Note: FFTW_EXTERN is used for "internal" functions used in tests/hook.c */ cannam@127: cannam@127: FFTW_EXTERN printer *X(mkprinter_file)(FILE *f); cannam@127: cannam@127: printer *X(mkprinter_cnt)(size_t *cnt); cannam@127: printer *X(mkprinter_str)(char *s); cannam@127: cannam@127: FFTW_EXTERN planner *X(the_planner)(void); cannam@127: void X(configure_planner)(planner *plnr); cannam@127: cannam@127: void X(mapflags)(planner *, unsigned); cannam@127: cannam@127: apiplan *X(mkapiplan)(int sign, unsigned flags, problem *prb); cannam@127: cannam@127: rdft_kind *X(map_r2r_kind)(int rank, const X(r2r_kind) * kind); cannam@127: cannam@127: typedef void (*planner_hook_t)(void); cannam@127: cannam@127: void X(set_planner_hooks)(planner_hook_t before, planner_hook_t after); cannam@127: cannam@127: #ifdef __cplusplus cannam@127: } /* extern "C" */ cannam@127: #endif /* __cplusplus */ cannam@127: cannam@127: #endif /* __API_H__ */