def reg_context(name, ctx):
 if (name in _context_reg):
  raise ValueError(('context name %s is already defined' % (name,)))
 if (not isinstance(ctx, gpuarray.GpuContext)):
  raise TypeError('context is not GpuContext')
 _context_reg[name] = ctx

def reg_context ( name , ctx ) : if ( name in _context_reg ) : raise ValueError ( ( 'context name %s is already defined' % ( name , ) ) ) if ( not isinstance ( ctx , gpuarray . GpuContext ) ) : raise TypeError ( 'context is not GpuContext' ) _context_reg [ name ] = ctx
register a context by mapping it to a name .