(verbose=False)
return count
Query device count through PyCuda.

    Arguments:
        verbose (bool): prints verbose logging if True, default False.

    Returns:
        int: Number of GPUs available.
Query device count through PyCuda.
Query device count through PyCuda .
def get_device_count(verbose=False):
    """
    Query device count through PyCuda.

    Arguments:
        verbose (bool): prints verbose logging if True, default False.

    Returns:
        int: Number of GPUs available.
    """
    try:
        import pycuda
        import pycuda.driver as drv
    except ImportError:
        if verbose:
            neon_logger.display("PyCUDA module not found")
        return 0
    try:
        drv.init()
    except pycuda._driver.RuntimeError as e:
        neon_logger.display("PyCUDA Runtime error: {0}".format(str(e)))
        return 0

    count = drv.Device.count()

    if verbose:
        neon_logger.display("Found {} GPU(s)".format(count))

    return count
def get_device_count ( verbose = False ) : try : import pycuda import pycuda . driver as drv except ImportError : if verbose : neon_logger . display ( "PyCUDA module not found" ) return 0 try : drv . init ( ) except pycuda . _driver . RuntimeError as e : neon_logger . display ( "PyCUDA Runtime error: {0}" . format ( str ( e ) ) ) return 0 count = drv . Device . count ( ) if verbose : neon_logger . display ( "Found {} GPU(s)" . format ( count ) ) return count