Factory#
A factory makes objects that compute FFTs.
The factory itself is made by either hpk.fft.makeFactoryCC() or
hpk.fft.makeFactoryRC().
To avoid unnecessary repetition, only the single precision classes for NumPy
are documented below.
Of course, float16, float32, and float64 are all similar, and numpy,
jax, torch, tensorflow, and arrayapi are also.
CLASSES
- class hpk.fft.FactoryCC_float32_numpy#
- FactoryCC_float32_numpy.makeInplace(self, layout: collections.abc.Sequence[hpk.fft.InplaceDim], batch: hpk.fft.InplaceDim = (1, 0)) hpk.fft.InplaceCC_float32#
Makes an object for computing in-place FFTs.
- Parameters:
layout – A sequence of InplaceDim, one for each FFT dimension.
batch – An optional InplaceDim describing multiple transforms.
- Returns:
A new InplaceCC compute object.
- FactoryCC_float32_numpy.makeOoplace(self, layout: collections.abc.Sequence[hpk.fft.OoplaceDim], batch: hpk.fft.OoplaceDim = (1, 0, 0)) hpk.fft.OoplaceCC_float32#
Makes an object for computing out-of-place FFTs.
- Parameters:
layout – A sequence of OoplaceDim, one for each FFT dimension.
batch – An optional OoplaceDim describing multiple transforms.
- Returns:
A new OoplaceCC compute object.
- FactoryCC_float32_numpy.maxThreads(self) int#
An upper bound on the number of threads that could be used.
- FactoryCC_float32_numpy.nextFastLayout(self, arg: collections.abc.Sequence[hpk.fft.InplaceDim], /) list[hpk.fft.InplaceDim]#
- FactoryCC_float32_numpy.nextFastLayout(self, arg: collections.abc.Sequence[hpk.fft.OoplaceDim], /) list[hpk.fft.OoplaceDim]
Increases
nin each dimension as necessary so each FFT dimension has a natively supported factorization. Strides are not updated.- Parameters:
arg – A sequence of InplaceDim or OoplaceDim, one for each FFT dimension.
- Returns:
A new list having natively supported FFT lengths.
- class hpk.fft.FactoryRC_float32_numpy#
- FactoryRC_float32_numpy.makeInplace(self, layout: collections.abc.Sequence[hpk.fft.InplaceDim], batch: hpk.fft.InplaceDim = (1, 0)) hpk.fft.InplaceRC_float32#
Makes an object for computing in-place FFTs.
- Parameters:
layout – A sequence of InplaceDim, one for each FFT dimension.
batch – An optional InplaceDim describing multiple transforms.
- Returns:
A new InplaceRC compute object.
- FactoryRC_float32_numpy.makeOoplace(self, layout: collections.abc.Sequence[hpk.fft.OoplaceDim], batch: hpk.fft.OoplaceDim = (1, 0, 0)) hpk.fft.OoplaceRC_float32#
Makes an object for computing out-of-place FFTs.
- Parameters:
layout – A sequence of OoplaceDim, one for each FFT dimension.
batch – An optional OoplaceDim describing multiple transforms.
- Returns:
A new OoplaceRC compute object.
- FactoryRC_float32_numpy.maxThreads(self) int#
An upper bound on the number of threads that could be used.
- FactoryRC_float32_numpy.nextFastLayout(self, arg: collections.abc.Sequence[hpk.fft.InplaceDim], /) list[hpk.fft.InplaceDim]#
- FactoryRC_float32_numpy.nextFastLayout(self, arg: collections.abc.Sequence[hpk.fft.OoplaceDim], /) list[hpk.fft.OoplaceDim]
Increases
nin each dimension as necessary so each FFT dimension has a natively supported factorization. Strides are not updated.- Parameters:
arg – A sequence of InplaceDim or OoplaceDim, one for each FFT dimension.
- Returns:
A new list having natively supported FFT lengths.