In this article
An in-place real transform shares storage between representations whose logical element sizes and physical row lengths differ.
Separate signal length from storage capacity
A signal buffer contains its real samples and is reused as the output of a real-to-complex transform. The rocFFT real-data guide explains the non-redundant Hermitian representation. For a contiguous logical length N, that representation contains floor(N/2)+1 complex values. Each complex value occupies real and imaginary components. Consequently, allocating only the logical real-signal length is not sufficient for the corresponding in-place interleaved output layout.
Compute physical padding for the chosen case
For that contiguous in-place case, capacity in real scalar units must accommodate 2*(floor(N/2)+1). Even and odd lengths therefore need separate attention; a remembered rule about extra samples from an even-length example should not replace the formula. Logical signal length remains N. Padding is storage capacity, not an instruction to transform a longer signal. Keep those quantities separate in allocation, input initialization and validation of the transformed spectrum.
Preserve input and output units
The rocFFT API reference defines layout descriptions, strides and distances. Real input strides and complex output strides can express the same physical storage using different element units. Blindly copying a real-row distance into a complex-layout field can therefore describe the wrong addresses. Extend the layout diagram to batches and higher dimensions before setting custom parameters. A sufficiently large overall allocation does not repair an incorrect per-row or per-batch interpretation.
Distinguish data padding from working memory
The rocFFT workflow guide separately describes plan construction, execution and optional work-buffer requirements. Internal working storage is not the same resource as physical padding in the user data buffer. Query and supply the required work buffer according to the chosen plan while preserving the data layout independently. Calling a transform in-place does not promise that the library needs no additional algorithm workspace or that every input representation supports the same placement.
Check both parity cases and known spectra
Validate an even-length and an odd-length signal with recognizable expected transforms. Inspect logical output values and memory boundaries, then extend the fixture to the intended batch layout. Related guides on HIP portability and software reproducibility support the process. This establishes correct physical storage for a declared transform, not arbitrary Hermitian validity after spectrum modification or an automatic normalization policy for a later inverse transform.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.