Discrete Fourier Transform Functions#
oneMath provides a DPC++ interface to
Definitions#
Let
For every
where
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”.
oneMath supports single-precision (fp32) and double-precision (fp64) floating-point arithmetic for the calculation of DFTs, using two kinds of forward domains:
the set of complex
-dimensional discrete sequences, referred to as “complex forward domain”;the set of real
-dimensional discrete sequences, referred to as “real forward domain”.
Similarly, we refer to DFTs of complex (resp. real) forward domain as “complex DFTs” (resp. “real DFTs”). Regardless of the kind of forward domain, the backward domain’s data sequences are always complex.
The calculation of the same DFT for several, i.e.,
Elementary range of indices#
In general, all entries of multi-indices
In other words, oneMath expects and produces a set of
; , if ; , except for backward domain’s data sequences of real DFTs; , for backward domain’s data sequences of real DFTs.
Additional constraints for data in backward domain of real DFTs#
Finally, note that the conjugate symmetry relation further constrains some of
the entries (or pairs thereof) in the backward domain’s data sequences for real
DFTs. Specifically, for any of the
the imaginary part must be
for any entry of multi-index such that , e.g., entry of multi-index ;pairs of entries of multi-indices
and such that must be complex conjugates of one another, e.g., entries of multi-indices and must be complex conjugates (note that this case falls back to the above constraint if ).
Note
The behavior of oneMath is undefined for real backward DFT if the input data does not satisfy those constraints. oneMath considers it the user’s responsibility to guarantee that these constraints are satisfied by the input data for real backward DFTs.
Recommended usage#
The desired DFT to be computed is entirely defined by an object desc of a
specialization of the oneapi::math::dft::descriptor
class template.
The desired floating-point format and kind of forward domain are determined by
desc’s particular class, i.e., by the specialization values of the
template parameters prec
and dom of the descriptor class template, respectively. Once desc is
created, the length(s) desc for every relevant configuration parameter (e.g., the number
desc must be initialized for computation by using its
committing member function, which requires
a sycl::queue object. The successful completion of that operation makes
desc ready to compute the desired DFT as configured, for the particular
device and context encapsulated by the latter. desc may then be used with
user-provided, device-accessible data, in a
oneapi::math::dft::compute_forward (resp.
oneapi::math::dft::compute_backward) function to enqueue operations relevant
to the desired forward (resp. backward) DFT calculations.
Note
Objects of any oneapi::math::dft::descriptor class
must be successfully committed prior to providing them to any compute function;
must be re-committed to account for any change in configuration operated after they were already successfully committed;
deliver best performance for DFT calculations when created, configured and committed outside applications’ hotpath(s) that use them multiple times for identically-configured DFTs.
oneapi::math::dft::compute_forwardand/oroneapi::math::dft::compute_backwardshould be the only oneMath DFT-related routines invoked in programs’ hotpaths.
Summary table#
The table below summarizes the identifiers of the oneapi::math::dft namespace
relevant to computing DFTs.
Identifier in |
Description |
|---|---|
|
A template for classes whose instances define a specific DFT to be calculated and its configuration. Template parameters are omitted in this table for conciseness (more details are available in the page dedicated to the descriptor class template). |
|
Scoped enumerations pertaining to the
definition of any configuration parameter or its associated
value, for any instance of a |
|
Member functions to
set (writable) configuration parameters
for any instance of a |
|
Member functions to
query configuration parameters
from any instance of a |
|
A member function to
commit any instance
of a |
|
A member function to equip any instance of a |
|
Function templates for computing a forward DFT, as defined by
a (successfully-committed) instance of a |
|
Function templates for computing a backward DFT, as defined by
a (successfully-committed) instance of a |
Parent topic: oneMath Domains