Ooplace#
Objects for computing Fast Fourier Transforms out of place, i.e., the input data is treated as read-only and the output data is written to a distinct, non-overlapping array. A method for conveniently allocating scratch memory is also provided.
These objects are made using the makeOoplace method of a Factory.
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.OoplaceCC_float32_numpy#
- OoplaceCC_float32_numpy.forward(self, arg0: ndarray[device='cpu', writable=False], arg1: ndarray[dtype=float32, device='cpu'] | None = None) numpy.ndarray[order='C', device='cpu']#
Computes an unscaled out-of-place forward FFT on complex data.
- Parameters:
arg0 – The input array to transform.
arg1 – An optional array to be used as scratch memory.
- Returns:
A new array containing the transformed data.
- OoplaceCC_float32_numpy.forwardCopy(self, arg0: ndarray[device='cpu', writable=False], arg1: ndarray[device='cpu'], arg2: ndarray[dtype=float32, device='cpu'] | None = None) None#
Computes an unscaled out-of-place forward FFT on complex data.
- Parameters:
arg0 – The input array to transform.
arg1 – The output array.
arg2 – An optional array to be used as scratch memory.
- OoplaceCC_float32_numpy.backward(self, arg0: ndarray[device='cpu', writable=False], arg1: ndarray[dtype=float32, device='cpu'] | None = None) numpy.ndarray[order='C', device='cpu']#
Computes an unscaled out-of-place backward FFT on complex data.
- Parameters:
arg0 – The input array to transform.
arg1 – An optional array to be used as scratch memory.
- Returns:
A new array containing the transformed data.
- OoplaceCC_float32_numpy.backwardCopy(self, arg0: ndarray[device='cpu', writable=False], arg1: ndarray[device='cpu'], arg2: ndarray[dtype=float32, device='cpu'] | None = None) None#
Computes an unscaled out-of-place backward FFT on complex data.
- Parameters:
arg0 – The input array to transform.
arg1 – The output array.
arg2 – An optional array to be used as scratch memory.
- OoplaceCC_float32_numpy.scaleForward(self, arg0: float, arg1: ndarray[device='cpu', writable=False], arg2: ndarray[dtype=float32, device='cpu'] | None = None) numpy.ndarray[order='C', device='cpu']#
Computes a scaled out-of-place forward FFT on complex data.
- Parameters:
arg0 – A real-valued scaling factor.
arg1 – The input array to transform.
arg2 – An optional array to be used as scratch memory.
- Returns:
A new array containing the transformed data.
- OoplaceCC_float32_numpy.scaleForwardCopy(self, arg0: float, arg1: ndarray[device='cpu', writable=False], arg2: ndarray[device='cpu'], arg3: ndarray[dtype=float32, device='cpu'] | None = None) None#
Computes a scaled out-of-place forward FFT on complex data.
- Parameters:
arg0 – A real-valued scaling factor.
arg1 – The input array to transform.
arg2 – The output array.
arg3 – An optional array to be used as scratch memory.
- OoplaceCC_float32_numpy.scaleBackward(self, arg0: float, arg1: ndarray[device='cpu', writable=False], arg2: ndarray[dtype=float32, device='cpu'] | None = None) numpy.ndarray[order='C', device='cpu']#
Computes a scaled out-of-place backward FFT on complex data.
- Parameters:
arg0 – A real-valued scaling factor.
arg1 – The input array to transform.
arg2 – An optional array to be used as scratch memory.
- Returns:
A new array containing the transformed data.
- OoplaceCC_float32_numpy.scaleBackwardCopy(self, arg0: float, arg1: ndarray[device='cpu', writable=False], arg2: ndarray[device='cpu'], arg3: ndarray[dtype=float32, device='cpu'] | None = None) None#
Computes a scaled out-of-place backward FFT on complex data.
- Parameters:
arg0 – A real-valued scaling factor.
arg1 – The input array to transform.
arg2 – The output array.
arg3 – An optional array to be used as scratch memory.
- OoplaceCC_float32_numpy.maxThreads(self) int#
An upper bound on the number of threads that could be used.
- OoplaceCC_float32_numpy.scratchSize(self) int#
Returns the number of floats needed as scratch space.
- OoplaceCC_float32_numpy.allocateScratch(self) ArrayLike[dtype=float32, order='C', device='cpu'] | None#
Allocates scratch memory for this FFT compute object.
- class hpk.fft.OoplaceRC_float32_numpy#
- OoplaceRC_float32_numpy.forward(self, arg0: ndarray[dtype=float32, device='cpu', writable=False], arg1: ndarray[dtype=float32, device='cpu'] | None = None) numpy.ndarray[dtype=float32, order='C', device='cpu']#
Computes an unscaled out-of-place forward FFT on real data.
- Parameters:
arg0 – The input array to transform.
arg1 – An optional array to be used as scratch memory.
- Returns:
A new array containing the transformed data.
- OoplaceRC_float32_numpy.forwardCopy(self, arg0: ndarray[dtype=float32, device='cpu', writable=False], arg1: ndarray[device='cpu'], arg2: ndarray[dtype=float32, device='cpu'] | None = None) None#
Computes an unscaled out-of-place forward FFT on real data.
- Parameters:
arg0 – The input array to transform.
arg1 – The output array.
arg2 – An optional array to be used as scratch memory.
- OoplaceRC_float32_numpy.backward(self, arg0: ndarray[device='cpu', writable=False], arg1: ndarray[dtype=float32, device='cpu'] | None = None) numpy.ndarray[dtype=float32, order='C', device='cpu']#
Computes an unscaled out-of-place backward FFT on complex Hermitian data.
- Parameters:
arg0 – The input array to transform.
arg1 – An optional array to be used as scratch memory.
- Returns:
A new array containing the transformed data.
- OoplaceRC_float32_numpy.backwardCopy(self, arg0: ndarray[device='cpu', writable=False], arg1: ndarray[dtype=float32, device='cpu'], arg2: ndarray[dtype=float32, device='cpu'] | None = None) None#
Computes an unscaled out-of-place backward FFT on complex Hermitian data.
- Parameters:
arg0 – The input array to transform.
arg1 – The output array.
arg2 – An optional array to be used as scratch memory.
- OoplaceRC_float32_numpy.scaleForward(self, arg0: float, arg1: ndarray[dtype=float32, device='cpu', writable=False], arg2: ndarray[dtype=float32, device='cpu'] | None = None) numpy.ndarray[dtype=float32, order='C', device='cpu']#
Computes a scaled out-of-place forward FFT on real data.
- Parameters:
arg0 – A real-valued scaling factor.
arg1 – The input array to transform.
arg2 – An optional array to be used as scratch memory.
- Returns:
A new array containing the transformed data.
- OoplaceRC_float32_numpy.scaleForwardCopy(self, arg0: float, arg1: ndarray[dtype=float32, device='cpu', writable=False], arg2: ndarray[device='cpu'], arg3: ndarray[dtype=float32, device='cpu'] | None = None) None#
Computes a scaled out-of-place forward FFT on real data.
- Parameters:
arg0 – A real-valued scaling factor.
arg1 – The input array to transform.
arg2 – The output array.
arg3 – An optional array to be used as scratch memory.
- OoplaceRC_float32_numpy.scaleBackward(self, arg0: float, arg1: ndarray[device='cpu', writable=False], arg2: ndarray[dtype=float32, device='cpu'] | None = None) numpy.ndarray[dtype=float32, order='C', device='cpu']#
Computes a scaled out-of-place backward FFT on complex Hermitian data.
- Parameters:
arg0 – A real-valued scaling factor.
arg1 – The input array to transform.
arg2 – An optional array to be used as scratch memory.
- Returns:
A new array containing the transformed data.
- OoplaceRC_float32_numpy.scaleBackwardCopy(self, arg0: float, arg1: ndarray[device='cpu', writable=False], arg2: ndarray[dtype=float32, device='cpu'], arg3: ndarray[dtype=float32, device='cpu'] | None = None) None#
Computes a scaled out-of-place backward FFT on complex Hermitian data.
- Parameters:
arg0 – A real-valued scaling factor.
arg1 – The input array to transform.
arg2 – The output array.
arg3 – An optional array to be used as scratch memory.
- OoplaceRC_float32_numpy.maxThreads(self) int#
An upper bound on the number of threads that could be used.
- OoplaceRC_float32_numpy.scratchSize(self) int#
Returns the number of floats needed as scratch space.
- OoplaceRC_float32_numpy.allocateScratch(self) ArrayLike[dtype=float32, order='C', device='cpu'] | None#
Allocates scratch memory for this FFT compute object.