def init_device(**kwargs):
    """same arguments as OCLDevice.__init__
    e.g.
    id_platform = 0
    id_device = 1
    ....
    """
    new_device = OCLDevice(**kwargs)

    # just change globals if new_device is different from old
    if _ocl_globals.device.device != new_device.device:
        _ocl_globals.device = new_device
same arguments as OCLDevice.__init__
    e.g.
    id_platform = 0
    id_device = 1
    ....