@@ -1637,6 +1637,81 @@ get_device_info<ext::intel::esimd::info::device::has_2d_block_io_support>(
16371637 UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAG_STORE);
16381638}
16391639
1640+ template <>
1641+ inline ext::intel::info::device::current_clock_throttle_reasons::return_type
1642+ get_device_info<ext::intel::info::device::current_clock_throttle_reasons>(
1643+ const DeviceImplPtr &Dev) {
1644+ if (!Dev->has (aspect::ext_intel_current_clock_throttle_reasons))
1645+ throw exception (make_error_code (errc::feature_not_supported),
1646+ " The device does not have the "
1647+ " ext_intel_current_clock_throttle_reasons aspect" );
1648+
1649+ ur_device_throttle_reasons_flags_t UrThrottleReasons;
1650+ Dev->getAdapter ()->call <UrApiKind::urDeviceGetInfo>(
1651+ Dev->getHandleRef (),
1652+ UrInfoCode<
1653+ ext::intel::info::device::current_clock_throttle_reasons>::value,
1654+ sizeof (UrThrottleReasons), &UrThrottleReasons, nullptr );
1655+ std::vector<ext::intel::throttle_reason> ThrottleReasons;
1656+ constexpr std::pair<ur_device_throttle_reasons_flags_t ,
1657+ ext::intel::throttle_reason>
1658+ UR2SYCLMappings[] = {{UR_DEVICE_THROTTLE_REASONS_FLAG_POWER_CAP,
1659+ ext::intel::throttle_reason::power_cap},
1660+ {UR_DEVICE_THROTTLE_REASONS_FLAG_CURRENT_LIMIT,
1661+ ext::intel::throttle_reason::current_limit},
1662+ {UR_DEVICE_THROTTLE_REASONS_FLAG_THERMAL_LIMIT,
1663+ ext::intel::throttle_reason::thermal_limit},
1664+ {UR_DEVICE_THROTTLE_REASONS_FLAG_PSU_ALERT,
1665+ ext::intel::throttle_reason::psu_alert},
1666+ {UR_DEVICE_THROTTLE_REASONS_FLAG_SW_RANGE,
1667+ ext::intel::throttle_reason::sw_range},
1668+ {UR_DEVICE_THROTTLE_REASONS_FLAG_HW_RANGE,
1669+ ext::intel::throttle_reason::hw_range},
1670+ {UR_DEVICE_THROTTLE_REASONS_FLAG_OTHER,
1671+ ext::intel::throttle_reason::other}};
1672+
1673+ for (const auto &[UrFlag, SyclReason] : UR2SYCLMappings) {
1674+ if (UrThrottleReasons & UrFlag) {
1675+ ThrottleReasons.push_back (SyclReason);
1676+ }
1677+ }
1678+ return ThrottleReasons;
1679+ }
1680+
1681+ template <>
1682+ inline ext::intel::info::device::fan_speed::return_type
1683+ get_device_info<ext::intel::info::device::fan_speed>(const DeviceImplPtr &Dev) {
1684+ if (!Dev->has (aspect::ext_intel_fan_speed))
1685+ throw exception (make_error_code (errc::feature_not_supported),
1686+ " The device does not have the ext_intel_fan_speed aspect" );
1687+ using Param = ext::intel::info::device::fan_speed;
1688+ return get_device_info_impl<Param::return_type, Param>::get (Dev);
1689+ }
1690+
1691+ template <>
1692+ inline ext::intel::info::device::max_power_limit::return_type
1693+ get_device_info<ext::intel::info::device::max_power_limit>(
1694+ const DeviceImplPtr &Dev) {
1695+ if (!Dev->has (aspect::ext_intel_power_limits))
1696+ throw exception (
1697+ make_error_code (errc::feature_not_supported),
1698+ " The device does not have the ext_intel_power_limits aspect" );
1699+ using Param = ext::intel::info::device::max_power_limit;
1700+ return get_device_info_impl<Param::return_type, Param>::get (Dev);
1701+ }
1702+
1703+ template <>
1704+ inline ext::intel::info::device::min_power_limit::return_type
1705+ get_device_info<ext::intel::info::device::min_power_limit>(
1706+ const DeviceImplPtr &Dev) {
1707+ if (!Dev->has (aspect::ext_intel_power_limits))
1708+ throw exception (
1709+ make_error_code (errc::feature_not_supported),
1710+ " The device does not have the ext_intel_power_limits aspect" );
1711+ using Param = ext::intel::info::device::min_power_limit;
1712+ return get_device_info_impl<Param::return_type, Param>::get (Dev);
1713+ }
1714+
16401715// Returns the list of all progress guarantees that can be requested for
16411716// work_groups from the coordination level of root_group when using the device
16421717// given by Dev. First it calls getProgressGuarantee to get the strongest
0 commit comments