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