def _setup():
    global _ctx
    global _queue
    global _pref_work_group_count
    global _max_local_memory
    global _address_bits
    global _max_work_group_size
    global _has_dpfloat
    global _warpsize
    global _AMD_fixes
    global _reduction_task_cache
    global _supports_64b_atomics

    _ctx = cl.create_some_context()
    _queue = cl.CommandQueue(_ctx, properties=cl.command_queue_properties.PROFILING_ENABLE)
    _pref_work_group_count = _queue.device.max_compute_units
    _max_local_memory = _queue.device.local_mem_size
    _address_bits = _queue.device.address_bits
    _max_work_group_size = _queue.device.max_work_group_size
    _has_dpfloat = 'cl_khr_fp64' in _queue.device.extensions or 'cl_amd_fp64' \
        in _queue.device.extensions
    if not _has_dpfloat:
        warning('device does not support double precision floating point \
                computation, expect undefined behavior for double')

    if 'cl_khr_int64_base_atomics' in _queue.device.extensions:
        _supports_64b_atomics = True

    if _queue.device.type == cl.device_type.CPU:
        _warpsize = 1
    elif _queue.device.type == cl.device_type.GPU:
        # assumes nvidia, will probably fail with AMD gpus
        _warpsize = 32

    _AMD_fixes = ['Advanced Micro Devices, Inc.'] in _queue.device.platform.vendor
    _reduction_task_cache = dict()
dataset/ETHPy150Open OP2/PyOP2/pyop2/opencl.py/_setup/swapped operands of `in`