factorization_cufft_pad.py
def closest_optimal(n, search_next_largest: bool=True, allowed_factors=(2,3,5,7)):
    """ Finds closest optimal array dimensions for cuFFT
    
    Parameters
    ----------
    n : iterable of integers
        Input dimensions
    search_next_largest : bool
        if True (default) search closest optimal dimensions that are larger or equal to original
        otherwise look for smaller ones. 
    allowed_factor: tuple of integers
        allowed factors in decomposition. Defaults to (2,3,5,7) which are the factors listed in 
        the cuFFT documentation. 
    
    Returns
    -------
    np.array of ints
        optimal dimensions for cuFFT
        
        
    See also
    --------
    https://docs.nvidia.com/cuda/cufft/index.html
    
    """
    n = np.asarray(n)
    scalar_input = False
    if n.ndim == 0:
        n = n[None] 
        scalar_input = True
    ret = np.array([_closest_optimal(ni, search_next_largest, allowed_factors) for ni in n])
    if scalar_input:
        return ret[0]
    return ret
 Finds closest optimal array dimensions for cuFFT
    
    Parameters
    ----------
    n : iterable of integers
        Input dimensions
    search_next_largest : bool
        if True (default) search closest optimal dimensions that are larger or equal to original
        otherwise look for smaller ones. 
    allowed_factor: tuple of integers
        allowed factors in decomposition. Defaults to (2,3,5,7) which are the factors listed in 
        the cuFFT documentation. 
    
    Returns
    -------
    np.array of ints
        optimal dimensions for cuFFT
        
        
    See also
    --------
    https://docs.nvidia.com/cuda/cufft/index.html
    
    
Finds closest optimal array dimensions for cuFFT
Finds closest optimal array dimensions for cuFFT
def closest_optimal(n, search_next_largest: bool=True, allowed_factors=(2,3,5,7)):
    n = np.asarray(n)
    scalar_input = False
    if n.ndim == 0:
        n = n[None] 
        scalar_input = True
    ret = np.array([_closest_optimal(ni, search_next_largest, allowed_factors) for ni in n])
    if scalar_input:
        return ret[0]
    return ret
def closest_optimal ( n , search_next_largest : bool = True , allowed_factors = ( 2 , 3 , 5 , 7 ) ) : n = np . asarray ( n ) scalar_input = False if n . ndim == 0 : n = n [ None ] scalar_input = True ret = np . array ( [ _closest_optimal ( ni , search_next_largest , allowed_factors ) for ni in n ] ) if scalar_input : return ret [ 0 ] return ret
Finds closest optimal array dimensions for cuFFT
Finds closest optimal array dimensions for cuFFT
""" Finds closest optimal array dimensions for cuFFT
    
    Parameters
    ----------
    n : iterable of integers
        Input dimensions
    search_next_largest : bool
        if True (default) search closest optimal dimensions that are larger or equal to original
        otherwise look for smaller ones. 
    allowed_factor: tuple of integers
        allowed factors in decomposition. Defaults to (2,3,5,7) which are the factors listed in 
        the cuFFT documentation. 
    
    Returns
    -------
    np.array of ints
        optimal dimensions for cuFFT
        
        
    See also
    --------
    https://docs.nvidia.com/cuda/cufft/index.html
    
    """
optimal dimensions for cuFFT
optimal dimensions for cuFFT
np.array of ints

None
See also

None
--------

None
//docs.nvidia.com/cuda/cufft/index.html

n
None
search_next_largest
bool
if True (default) search closest optimal dimensions that are larger or equal to original
otherwise look for smaller ones.
if True ( default ) search closest optimal dimensions that are larger or equal to original otherwise look for smaller ones .
allowed_factors
allowed_factor
allowed factors in decomposition. Defaults to (2,3,5,7) which are the factors listed in
the cuFFT documentation.
allowed factors in decomposition . Defaults to ( 2 3 5 7 ) which are the factors listed in the cuFFT documentation .
s