using NvAPIWrapper.Native.GPU;
using NvAPIWrapper.Native.GPU.Structures;
namespace NvAPIWrapper.GPU
{
///
/// Holds information regarding a possible power limit policy and its acceptable range
///
public class GPUPowerLimitInfo
{
internal GPUPowerLimitInfo(PrivatePowerPoliciesInfoV1.PowerPolicyInfoEntry powerPolicyInfoEntry)
{
PerformanceStateId = powerPolicyInfoEntry.PerformanceStateId;
MinimumPowerInPCM = powerPolicyInfoEntry.MinimumPowerInPCM;
DefaultPowerInPCM = powerPolicyInfoEntry.DefaultPowerInPCM;
MaximumPowerInPCM = powerPolicyInfoEntry.MaximumPowerInPCM;
}
///
/// Gets the default policy target power in per cent mille (PCM)
///
public uint DefaultPowerInPCM { get; }
///
/// Gets the default policy target power in percentage
///
public float DefaultPowerInPercent
{
get => DefaultPowerInPCM / 1000f;
}
///
/// Gets the maximum possible policy target power in per cent mille (PCM)
///
public uint MaximumPowerInPCM { get; }
///
/// Gets the maximum possible policy target power in percentage
///
public float MaximumPowerInPercent
{
get => MaximumPowerInPCM / 1000f;
}
///
/// Gets the minimum possible policy target power in per cent mille (PCM)
///
public uint MinimumPowerInPCM { get; }
///
/// Gets the minimum possible policy target power in percentage
///
public float MinimumPowerInPercent
{
get => MinimumPowerInPCM / 1000f;
}
///
/// Gets the corresponding performance state identification
///
public PerformanceStateId PerformanceStateId { get; }
///
public override string ToString()
{
return
$"[{PerformanceStateId}] Default: {DefaultPowerInPercent}% - Range: ({MinimumPowerInPercent}% - {MaximumPowerInPercent}%)";
}
}
}