Developer Reference

  • 0.9
  • 09/09/2020
  • Public Content
Contents

DFTI_INPUT_STRIDES, DFTI_OUTPUT_STRIDES

The FFT interface provides configuration parameters that define the layout of multidimensional data in the computer memory. For
d
-dimensional data set
X
defined by dimensions
N
1
x
N
2
x ... x
N
d
, the layout describes where a particular element
X
(
k
1
,
k
2
, ...,
k
d
) of the data set is located. The memory address of the element
X
(
k
1
,
k
2
, ...,
k
d
) is expressed by the formula,
address of
X
(
k
1
,
k
2
, ...,
k
d
) = the pointer supplied to the compute function +
s
0
+
k
1
*
s
1
+
k
2
*
s
2
+ ...+
k
d
*
s
d
,
where
s
0
is the displacement and
s
1
, ...,
s
d
are generalized strides. The configuration parameters
DFTI_INPUT_STRIDES
and
DFTI_OUTPUT_STRIDES
enable you to get and set these values. The configuration value is an array of values (
s
0
,
s
1
, ...,
s
d
) of
MKL_LONG
data type
.
The offset is counted in elements of the data type (complex or real) defined by the descriptor configuration as tabulated below. The computation functions take pointers which are typed as real arrays regardless of the descriptor configuration. Specifically, the
DFTI_FORWARD_DOMAIN, DFTI_COMPLEX_STORAGE, and DFTI_CONJUGATE_EVEN_STORAGE
configuration parameters define the type of the elements as shown in Table
"Assumed Element Types of the Input/Output Data"
:
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
Real
Real
DFTI_FORWARD_DOMAIN=DFTI_REAL
DFTI_CONJUGATE_EVEN_STORAGE=DFTI_COMPLEX_COMPLEX
Real
Complex
The
DFTI_INPUT_STRIDES
configuration parameter defines the layout of the input data, while the element type is defined by the forward domain for the
DftiComputeForward
function and by the backward domain for the
DftiComputeBackward
function. The
DFTI_OUTPUT_STRIDES
configuration parameter defines the layout of the output data, while the element type is defined by the backward domain for the
DftiComputeForward
function and by the forward domain for
DftiComputeBackward
function.
The
DFTI_INPUT_STRIDES
and
DFTI_OUTPUT_STRIDES
configuration parameters define the layout of input and output data, and not the forward-domain and backward-domain data. If the data layouts in forward domain and backward domain differ, set
DFTI_INPUT_STRIDES
and
DFTI_OUTPUT_STRIDES
explicitly and then commit the descriptor before calling computation functions.
For in-place transforms (
DFTI_PLACEMENT=DFTI_INPLACE
), the configuration set by
DFTI_OUTPUT_STRIDES
is ignored when the element types in the forward and backward domains are the same. If they are different, set
DFTI_OUTPUT_STRIDES
explicitly (even though the transform is in-place). Ensure a consistent configuration for in-place transforms, that is, the locations of the first elements on input and output must coincide in each dimension.
The FFT interface supports both positive and negative stride values. If you use negative strides, set the displacement of the data as follows:
The default setting of strides in a general multi-dimensional case assumes that the array that contains the data has no padding. The order of the strides depends on the programming language. For example:
MKL_LONG dims[] = { n
d
, …, n
2
, n
1
}; DftiCreateDescriptor( &hand, precision, domain, d, dims ); // The above call assumes data declaration: type X[n
d
]…[n
2
][n
1
] // Default strides are { 0, n
d-1
*…*n
2
*n
1
, …, n
2
*n
1
*1, n
1
*1, 1 }
Note that in case of a real FFT (
DFTI_FORWARD_DOMAIN=DFTI_REAL
), where different data layouts in the backward domain are available (see
DFTI_PACKED_FORMAT
), the default value of the strides is not intuitive for the recommended CCE format (configuration setting
DFTI_CONJUGATE_EVEN_STORAGE=DFTI_COMPLEX_COMPLEX
). In case of an
in-place
real transform with the CCE format, set the strides explicitly, as follows:
MKL_LONG dims[] = { n
d
, …, n
2
, n
1
}; MKL_LONG rstrides[] = { 0, 2*n
d-1
*…*n
2
*(n
1
/2+1), …, 2*n
2
*(n
1
/2+1), 2*(n
1
/2+1), 1 }; MKL_LONG cstrides[] = { 0, n
d-1
*…*n
2
*(n
1
/2+1), …, n
2
*(n
1
/2+1), (n
1
/2+1), 1 }; DftiCreateDescriptor( &hand, precision, DFTI_REAL, d, dims ); DftiSetValue(hand, DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX); // Set the strides appropriately for forward/backward transform
To better understand configuration of strides, you can also refer to these examples in your
Intel® oneAPI Math Kernel Library
directory:
./examples/dftc/source/basic_sp_complex_dft_2d.c
./examples/dftc/source/basic_sp_complex_dft_3d.c
./examples/dftc/source/basic_dp_complex_dft_2d.c
./examples/dftc/source/basic_dp_complex_dft_3d.c
./examples/dftc/source/basic_sp_real_dft_2d.c
./examples/dftc/source/basic_sp_real_dft_3d.c
./examples/dftc/source/basic_dp_real_dft_2d.c
./examples/dftc/source/basic_dp_real_dft_3d.c

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804