o
    ºiÇ  ã                   @   sT   U d dl mZmZmZ d dlZi Zeeeee f ef ed< dd„ Zd	dd„Z	dS )
é    )ÚDictÚListÚTupleNÚ_next_fast_len_cachec                 C   s~   t |ƒdkr	tjS t | |fd ¡}|d u r=| dkrd}n|d }tt| | d | |ƒ| t| |dd … ƒƒ}|t| |f< |S )Nr   é   )ÚlenÚmathÚinfr   ÚgetÚminÚ_next_fast_len_impl)ÚnÚprimesÚresultÚp© r   úT/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/cupyx/scipy/fft/_helper.pyr   	   s   þr   Fc                 C   s   | dkrdS d}t | |ƒS )aå  Find the next fast size to ``fft``.

    Args:
        target (int): The size of input array.
        real (bool): ``True`` if the FFT involves real input or output.
            This parameter is of no use, and only for compatibility to
            SciPy's interface.

    Returns:
        int: The smallest fast length greater than or equal to the input value.

    .. seealso:: :func:`scipy.fft.next_fast_len`

    .. note::
        It may return a different value to :func:`scipy.fft.next_fast_len`
        as pocketfft's prime factors are different from cuFFT's factors.
        For details, see the `cuFFT documentation`_.

    .. _cuFFT documentation:
        https://docs.nvidia.com/cuda/cufft/index.html#accuracy-and-performance
    r   )é   é   é   é   )r   )ÚtargetÚrealr   r   r   r   Únext_fast_len   s   
r   )F)
Útypingr   r   r   r   r   ÚintÚ__annotations__r   r   r   r   r   r   Ú<module>   s
     