DFTI_INPUT_STRIDES, DFTI_OUTPUT_STRIDES

In addition to supporting transforms of multiple number of data sets, FFT interface supports non-unit stride distribution of data within each data set. The stride parameter is an array of values of INTEGER data type in Fortran and MKL_LONG data type in C.

The stride values determine the memory layout of the input and output data.

An input data element X (n1, n2 , ..., nd) of a d-dimensional transform is located at offset nth*idistance + istride[0] + n1*istride[1] + ... + nd*istride[d] from the first element (the element pointed to by X). Here nth = 0, ... , M - 1 with M being the number of transforms defined by the DFTI_NUMBER_OF_TRANSFORMS configuration parameter, idistance is the spacing between the first elements of the data for the multiple transforms, as defined by the DFTI_INPUT_DISTANCE configuration parameter, and istride is the array of strides defined by the DFTI_INPUT_STRIDES configuration parameter.

The offset is counted in sizes of the respective data type rather than bytes. The type of the elements is defined by the descriptor configuration rather than by the type of the variable passed to the computation functions.

The FFT interface supports both positive and negative stride values. If you use negative strides, set the offset of the data as follows:

where N1, ..., Nd are the lengths of the transform and stride is a placeholder that can be either istride or ostride.

The DFTI_FORWARD_DOMAIN, DFTI_COMPLEX_STORAGE, DFTI_CONJUGATE_EVEN_STORAGE, and DFTI_PACKED_FORMAT configuration parameters define the type of the elements as shown in Table "Assumed Element Types of the Input/Output Data".

The output data layout depends on the DFTI_PLACEMENT configuration parameter:

Assumed Element Types of the Input/Output Data

Descriptor Configuration

Element Type in the Forward Domain

Element Type in the Backward Domain

DFTI_FORWARD_DOMAIN=DFTI_COMPLEX

DFTI_COMPLEX_STORAGE=DFTI_COMPLEX_COMPLEX

Complex

Complex

DFTI_FORWARD_DOMAIN=DFTI_COMPLEX

DFTI_COMPLEX_STORAGE=DFTI_REAL_REAL

Real

Real

DFTI_FORWARD_DOMAIN=DFTI_REAL

DFTI_CONJUGATE_EVEN_STORAGE=DFTI_COMPLEX_REAL

DFTI_PACKED_FORMAT={DFTI_CCS_FORMAT, DFTI_PACK_FORMAT, DFTI_PERM_FORMAT}

Real

Real

DFTI_FORWARD_DOMAIN=DFTI_REAL

DFTI_CONJUGATE_EVEN_STORAGE=DFTI_COMPLEX_COMPLEX

DFTI_PACKED_FORMAT=DFTI_CCE_FORMAT

Real

Complex

Consider the following situation where a 32-length FFT is to be computed on the sequence xj, 0j<32. The actual location of these values are in X(5), X(7), ..., X(67) of an array X(1:68). The stride accommodated by the FFT interface consists of a displacement from the first element of the data array L0, (4 in this case), and a constant distance of consecutive elements L1 (2 in this case). Thus for the Fortran array X

xj = X(1 + L0 + L1 * j) = X(5 + L1 * j).

This stride vector (4,2) is provided by a length-two rank-one integer array:

COMPLEX :: X(68)
INTEGER :: Stride(2)
...................
Status = DftiCreateDescriptor(Desc_Handle, DFTI_SINGLE,
 DFTI_COMPLEX, 1, 32)
Stride = (/ 4, 2 /)
Status = DftiSetValue(Desc_Handle, DFTI_INPUT_STRIDES, Stride)
Status = DftiSetValue(Desc_Handle, DFTI_OUTPUT_STRIDES, Stride)
Status = DftiCommitDescriptor(Desc_Handle)
Status = DftiComputeForward(Desc_Handle, X)
Status = DftiFreeDescriptor(Desc_Handle)
	

In general, for a d-dimensional transform, the stride is provided by a d+1-length integer vector (L0, L1, L2, ..., Ld) with the meaning:

L0 = displacement from the first array element

L1 = distance between consecutive data elements in the first dimension

L2 = distance between consecutive data elements in the second dimension

... = ...

Ld = distance between consecutive data elements in the d-th dimension.

A d-dimensional data sequence

Xj1 , j2 , ... , jd , 0ji Ji , 1id

will be stored in the rank-1 array X by the mapping

Xj1 , j2 , ... , jd = X (first index + L0 + j1L1 + j2L2 + ... + jdLd) .

For multiple transforms, the value L0 applies to the first data sequence, and Lj, j = 1, 2,..., d apply to all the data sequences.

In the case of a single one-dimensional sequence, L1 is simply the usual stride. The default setting of strides in the general multi-dimensional situation corresponds to the case where the sequences are distributed tightly into the array:

Both the input data and output data have a stride associated with it. The default is set in accordance with the data to be stored contiguously in memory in a way that is natural to the language.

Note that in case of a real FFT, where different formats are available, the default value is not the one that seems most natural for certain formats. For example, with the CCE format, strides are set by default to L1 = 1, L2 = J1 for a real transform regardless. However, for a complex matrix, slightly over half of the matrix is actually stored, and you should set strides to L1 = 1, L2 = J1/2+1. In case of an in-place transform with the CCE data format, even for a real array, you should set strides explicitly: L1 = 1, L2 = (J1/2+1)*2.

See Example "Computing 2D FFT by One-Dimensional Transforms" as an illustration of how to use the configuration parameters discussed above.

See Also


Submit feedback on this help topic

Copyright © 1994 - 2011, Intel Corporation. All rights reserved.