using NvAPIWrapper.Native.GPU;
using NvAPIWrapper.Native.GPU.Structures;
namespace NvAPIWrapper.GPU
{
///
/// Holds information regarding a currently active power limit policy
///
public class GPUPowerLimitPolicy
{
internal GPUPowerLimitPolicy(PrivatePowerPoliciesStatusV1.PowerPolicyStatusEntry powerPolicyStatusEntry)
{
PerformanceStateId = powerPolicyStatusEntry.PerformanceStateId;
PowerTargetInPCM = powerPolicyStatusEntry.PowerTargetInPCM;
}
///
/// Gets the corresponding performance state identification
///
public PerformanceStateId PerformanceStateId { get; }
///
/// Gets the current policy target power in per cent mille (PCM)
///
public uint PowerTargetInPCM { get; }
///
/// Gets the current policy target power in percentage
///
public float PowerTargetInPercent
{
get => PowerTargetInPCM / 1000f;
}
///
public override string ToString()
{
return $"{PerformanceStateId} Target: {PowerTargetInPercent}%";
}
}
}