parameters: (fn)
return_statement: return _require_cuda_context
docstring: A decorator that ensures a CUDA context is available when *fn* is executed.
  
      Note: The function *fn* cannot switch CUDA-context.
docstring_summary: A decorator that ensures a CUDA context is available when *fn* is executed.
docstring_tokens: A decorator that ensures a CUDA context is available when * fn * is executed .
function: def require_context(fn):
      """
      A decorator that ensures a CUDA context is available when *fn* is executed.
  
      Note: The function *fn* cannot switch CUDA-context.
      """
      @functools.wraps(fn)
      def _require_cuda_context(*args, **kws):
          with _runtime.ensure_context():
              return fn(*args, **kws)
  
      return _require_cuda_context
function_tokens: def require_context ( fn ) : @ functools . wraps ( fn ) def _require_cuda_context ( * args , * * kws ) : with _runtime . ensure_context ( ) : return fn ( * args , * * kws ) return _require_cuda_context