cannam@167: cannam@167: cannam@167: cannam@167: cannam@167:
cannam@167:cannam@167: Next: Wisdom, Previous: Guru Interface, Up: FFTW Reference [Contents][Index]
cannam@167:Normally, one executes a plan for the arrays with which the plan was
cannam@167: created, by calling fftw_execute(plan)
as described in Using Plans.
cannam@167:
cannam@167: However, it is possible for sophisticated users to apply a given plan
cannam@167: to a different array using the “new-array execute” functions
cannam@167: detailed below, provided that the following conditions are met:
cannam@167:
ii-ri
and io-ro
, are the same as they were for
cannam@167: the input and output arrays when the plan was created. (This
cannam@167: condition is automatically satisfied for interleaved arrays.)
cannam@167:
cannam@167: FFTW_UNALIGNED
flag.
cannam@167:
cannam@167: Here, the alignment is a platform-dependent quantity (for example, it is
cannam@167: the address modulo 16 if SSE SIMD instructions are used, but the address
cannam@167: modulo 4 for non-SIMD single-precision FFTW on the same machine). In
cannam@167: general, only arrays allocated with fftw_malloc
are guaranteed to
cannam@167: be equally aligned (see SIMD alignment and fftw_malloc).
cannam@167:
cannam@167: The alignment issue is especially critical, because if you don’t use
cannam@167: fftw_malloc
then you may have little control over the alignment
cannam@167: of arrays in memory. For example, neither the C++ new
function
cannam@167: nor the Fortran allocate
statement provide strong enough
cannam@167: guarantees about data alignment. If you don’t use fftw_malloc
,
cannam@167: therefore, you probably have to use FFTW_UNALIGNED
(which
cannam@167: disables most SIMD support). If possible, it is probably better for
cannam@167: you to simply create multiple plans (creating a new plan is quick once
cannam@167: one exists for a given size), or better yet re-use the same array for
cannam@167: your transforms.
cannam@167:
For rare circumstances in which you cannot control the alignment of
cannam@167: allocated memory, but wish to determine where a given array is
cannam@167: aligned like the original array for which a plan was created, you can
cannam@167: use the fftw_alignment_of
function:
cannam@167:
int fftw_alignment_of(double *p); cannam@167:
Two arrays have equivalent alignment (for the purposes of applying a
cannam@167: plan) if and only if fftw_alignment_of
returns the same value
cannam@167: for the corresponding pointers to their data (typecast to double*
cannam@167: if necessary).
cannam@167:
If you are tempted to use the new-array execute interface because you cannam@167: want to transform a known bunch of arrays of the same size, you should cannam@167: probably go use the advanced interface instead (see Advanced Interface)). cannam@167:
cannam@167:The new-array execute functions are: cannam@167:
cannam@167:void fftw_execute_dft( cannam@167: const fftw_plan p, cannam@167: fftw_complex *in, fftw_complex *out); cannam@167: cannam@167: void fftw_execute_split_dft( cannam@167: const fftw_plan p, cannam@167: double *ri, double *ii, double *ro, double *io); cannam@167: cannam@167: void fftw_execute_dft_r2c( cannam@167: const fftw_plan p, cannam@167: double *in, fftw_complex *out); cannam@167: cannam@167: void fftw_execute_split_dft_r2c( cannam@167: const fftw_plan p, cannam@167: double *in, double *ro, double *io); cannam@167: cannam@167: void fftw_execute_dft_c2r( cannam@167: const fftw_plan p, cannam@167: fftw_complex *in, double *out); cannam@167: cannam@167: void fftw_execute_split_dft_c2r( cannam@167: const fftw_plan p, cannam@167: double *ri, double *ii, double *out); cannam@167: cannam@167: void fftw_execute_r2r( cannam@167: const fftw_plan p, cannam@167: double *in, double *out); cannam@167:
These execute the plan
to compute the corresponding transform on
cannam@167: the input/output arrays specified by the subsequent arguments. The
cannam@167: input/output array arguments have the same meanings as the ones passed
cannam@167: to the guru planner routines in the preceding sections. The plan
cannam@167: is not modified, and these routines can be called as many times as
cannam@167: desired, or intermixed with calls to the ordinary fftw_execute
.
cannam@167:
The plan
must have been created for the transform type
cannam@167: corresponding to the execute function, e.g. it must be a complex-DFT
cannam@167: plan for fftw_execute_dft
. Any of the planner routines for that
cannam@167: transform type, from the basic to the guru interface, could have been
cannam@167: used to create the plan, however.
cannam@167:
cannam@167: Next: Wisdom, Previous: Guru Interface, Up: FFTW Reference [Contents][Index]
cannam@167: