def pick_opencl_cpu_platform(opencl_cpus):
    """
    Pick the best OpenCL implementation for the opencl cpu.
    This function assume that there is only one opencl-enabled CPU on the
    current machine, but there might be several OpenCL implementations/vendors.


    Parameters
    ----------
    opencl_cpus: dict
        Dictionary with the available opencl-enabled CPUs.
        Usually obtained with collect_opencl_cpus().

    Returns
    -------
    cpu: dict
        A dictionary describing the CPU.
    """
    if len(opencl_cpus) == 0:
        raise ValueError('No CPU to pick')
    name2device = {}
    for platform, devices in opencl_cpus.items():
        for device_id, device_desc in devices.items():
            name2device.setdefault(device_desc['name'], [])
            name2device[device_desc['name']].append(platform)
    if len(name2device) > 1:
        raise ValueError('Expected at most one CPU but got %d: %s' % (len(
            name2device), list(name2device.keys())))
    cpu_name = list(name2device.keys())[0]
    platforms = name2device[cpu_name]
    res = opencl_cpus[platforms[0]]
    if len(platforms) > 1:
        if 'intel' in cpu_name.lower():
            for platform in platforms:
                if 'intel' in platform.lower():
                    res = opencl_cpus[platform]
    return res[list(res.keys())[0]]
