(ctx)
Detach from a context cleanly.

    Detach from a context and remove its pop() from atexit.

    Parameters
    ----------
    ctx : pycuda.driver.Context
        Context from which to detach.
Detach from a context cleanly.
Detach from a context cleanly .
def done_context(ctx):
    """
    Detach from a context cleanly.

    Detach from a context and remove its pop() from atexit.

    Parameters
    ----------
    ctx : pycuda.driver.Context
        Context from which to detach.
    """

    for i in range(len(atexit._exithandlers)):
        if atexit._exithandlers[i][0] == ctx.pop:
            del atexit._exithandlers[i]
            break
    ctx.detach()
def done_context ( ctx ) : for i in range ( len ( atexit . _exithandlers ) ) : if atexit . _exithandlers [ i ] [ 0 ] == ctx . pop : del atexit . _exithandlers [ i ] break ctx . detach ( )