# Input and output distances

FFT interface in Intel MKL allows the computation of multiple number of transforms. Consequently, the user needs to be able to specify the data distribution of these multiple sets of data. This is accomplished by the distance between the first data element of the consecutive data sets. This parameter is obligatory if multiple number is more than one. The parameter is a value of Integer data type in Fortran and MKL_LONG data type in C. Data sets don't have any common elements. The following example illustrates the specification. Consider computing the forward FFT on three 32-length complex sequences stored in `X(0:31, 1)`, `X(0:31, 2)`, and `X(0:31, 3)`. Suppose the results are to be stored in the locations `Y(0:31, k)`, `k` = 1, 2, 3, of the array `Y(0:63, 3)`. Thus the input distance is 32, while the output distance is 64. Notice that the data and result parameters in computation functions are all declared as assumed-size rank-1 array `DIMENSION(0:*)`. Therefore two-dimensional array must be transformed to one-dimensional array by EQUIVALENCE statement or other facilities of Fortran. Here is the code fragment:

Complex :: X_2D(0:31,3), Y_2D(0:63, 3)

Complex :: X(96), Y(192)

Equivalence (X_2D, X)

Equivalence (Y_2D, Y)

...................

Status = DftiCreateDescriptor(Desc_Handle, DFTI_SINGLE,

DFTI_COMPLEX, 1, 32)

Status = DftiSetValue(Desc_Handle, DFTI_NUMBER_OF_TRANSFORMS, 3)

Status = DftiSetValue(Desc_Handle, DFTI_INPUT_DISTANCE, 32)

Status = DftiSetValue(Desc_Handle, DFTI_OUTPUT_DISTANCE, 64)

Status = DftiSetValue(Desc_Handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE)

Status = DftiCommitDescriptor(Desc_Handle)

Status = DftiComputeForward(Desc_Handle, X, Y)

Status = DftiFreeDescriptor(Desc_Handle)

Parent topic: Configuration Settings