Visible to Intel only — GUID: GUID-956AC6D3-D729-4BD7-9800-A165787D4F2A
Visible to Intel only — GUID: GUID-956AC6D3-D729-4BD7-9800-A165787D4F2A
Fourier Transform Functions
Definitions
Let be a set of -dimensional periodic discrete sequences of lengths (, , , and . Its -th sequence entries are denoted by .
The Discrete Fourier Transform (DFT) of is the -dimensional periodic discrete sequence whose entries are defined as
where and is a scale factor. In (1), determines one of the two “directions” of the DFT: defines the “forward DFT” while defines the “backward DFT”.
The domain of input (resp. output) discrete sequences for a forward (resp. backward) DFT is referred to as “forward domain”. Conversely, the domain of output (resp. input) discrete sequences for forward (resp. backward) DFT is referred to as “backward domain”. Two types of forward domains may be considered:
the set of complex -dimensional periodic sequences, referred to as “complex forward domain”;
the set of real -dimensional periodic sequences, referred to as “real forward domain”.
Similarly, DFTs of complex (resp. real) forward domain are referred to as “complex DFTs” (resp. “real DFTs”). Regardless of the type of forward domain, the backward domain’s data sequences are always complex.
The calculation of the same DFT for several, i.e., for , data sets of the same type of forward domain, using the same precision is referred to as a “batched DFT”.
Elementary range of non-redundant entries
In general, given the periodicity of the discrete data considered in any DFT, the data entries such that and suffice to determine any of the relevant -dimensional sequences unambiguously. In case of real DFTs, the data sequences in backward domain can be fully determined from a smaller set of entries. Indeed, if all entries of are real in (1), then the entries of are complex and, for any , where represents the conjugate of complex number .
This conjugate symmetry relation makes roughly half the data redundant in backward domain: in case of real DFTs, the data sequences in backward domain can be fully determined from any non-redundant set of entries such that , , and for any . In oneMKL, the convention is used for capturing such an elementary set of non-redundant entries for data sequences belonging to the backward domain of real DFTs.
In other words, oneMKL expects and produces a set of -dimensional finite data sequences such that
;
, if ;
, except for data sequences in the backward domain of real DFTs;
, for data sequences in the backward domain of real DFTs.
Finally, note that the conjugate symmetry relation further constrains some of the entries (or pairs thereof) of data sequences in the backward domain of real DFTs. Specifically,
the imaginary part must be for any entry such that , e.g., entry ;
pairs of entries and such that must be complex conjugates of one another, e.g., entries and must be complex conjugates (note that this example falls back into the latter category if ).
DPC++ Support
The Intel® oneAPI Math Kernel Library (oneMKL) provides a DPC++ interface for computing Discrete Fourier Transforms. The DPC++ interface emulates the usage model of the oneMKL C and Fortran Discrete Fourier Transform Interface (DFTI).
Unless a user-allocated workspace is used, the DPC++ interface computes a DFT in four steps:
Allocate a fresh descriptor for the problem with a call to the descriptor object constructor,
descriptor<precision, domain> desc(lengths);
The descriptor captures the configuration of the transform, such as the dimensionality (or rank), length(s), number of transforms, memory layout of the input/output data (defined by strides, distances and other configuration parameters), scaling factors, etc. All the configuration settings are assigned default values in this call which might need to be modified thereafter.
By default, descriptors are initialized for the in-place calculation of an unbatched (), unscaled () DFT of the forward domain, precision and length(s) that are set at construction time.
Optionally adjust the descriptor configuration by calling the descriptor<precision, domain>::set_value function as many times as needed, e.g., to specify a data storage layout(s) different than default. The configuration settings of the descriptor, such as the default values, can be obtained with the descriptor<precision, domain>::get_value function.
Commit the descriptor with a call to the descriptor<precision, domain>::commit function; that is, make the descriptor ready for the transform computation. Once the descriptor is committed, the parameters of the transform, such as the type and number of transforms, strides and distances, the type and storage layout of the data, and so on, are “frozen” in the descriptor. The commit function takes in a sycl::queue object to determine the device associated with the descriptor.
Compute the transform with a call to the compute_forward or compute_backward functions as many times as needed. Because the descriptor is defined and committed separately, the compute functions just take the input and output data and compute the transform as defined. To modify any configuration parameters for another call to a compute function, use
descriptor<precision, domain>::set_value
followed by
descriptor<precision, domain>::commit
before calling the compute function again.
All the above functions throw a named std::runtime_exception in the event of failure.
Some usage examples are provided in Configuring and computing a DFT in DPC++.