def get_device_capability(device: Optional[_device_t] = None) -> Dict[str, Any]:
    r"""Gets the xpu capability of a device.

    Args:
        device (torch.device or int, optional): device for which to return the
            device capability. It uses the current device, given by
            :func:`~torch.xpu.current_device`, if :attr:`device` is ``None``
            (default).

    Returns:
        Dict[str, Any]: the xpu capability dictionary of the device
    """
    prop = get_device_properties(device)
    return {
        "max_work_group_size": prop.max_work_group_size,
        "max_num_sub_groups": prop.max_num_sub_groups,
        "sub_group_sizes": prop.sub_group_sizes,
    }
Gets the xpu capability of a device.

    Args:
        device (torch.device or int, optional): device for which to return the
            device capability. It uses the current device, given by
            :func:`~torch.xpu.current_device`, if :attr:`device` is ``None``
            (default).

    Returns:
        Dict[str, Any]: the xpu capability dictionary of the device
    
intel_extension_for_pytorch/xpu/__init__.py