Skip to content

05_16_08_power_variants

Power-Aware Processing Variants

Status: ⏸️ NOT STARTED Priority: LOW Dependencies: TAREA 0 (Variant Framework) Estimated Effort: 1-2 weeks


🎯 Purpose

Power variants optimize for battery life and thermal management: - Low-power mode: Reduce CPU frequency/voltage - Battery-aware: Switch variants based on battery status - Thermal-aware: Throttle when CPU is hot - Efficiency cores: Use E-cores on Intel 12th gen+


πŸ“‹ Planned Features

1. Power-Efficient Variants

class PowerEfficientGainVariant : public IVariant {
public:
    bool process(const float* input, float* output, size_t numSamples) override;
    // Uses scalar (no SIMD) to save power

    PerformanceProfile getPerformanceProfile() const override {
        PerformanceProfile profile;
        profile.powerConsumptionWatts = 0.5f;  // Low
        profile.cyclesPerSample = 10.0f;       // Slow
        return profile;
    }
};

2. Battery Status Detection

class BatteryAwareDispatcher {
public:
    void updateContext() {
        context_.onBattery = isOnBatteryPower();
        context_.batteryPercent = getBatteryLevel();

        if (context_.onBattery && context_.batteryPercent < 20.0f) {
            // Switch to power-efficient variants
            dispatcher_.selectOptimalVariant(context_);
        }
    }
};

3. Thermal Throttling

class ThermalAwareVariant : public IVariant {
public:
    bool process(const float* input, float* output, size_t numSamples) override {
        float cpuTemp = getCPUTemperature();

        if (cpuTemp > 80.0f) {
            // Too hot, use slower variant to reduce heat
            return lowPowerVariant_->process(input, output, numSamples);
        }

        return normalVariant_->process(input, output, numSamples);
    }
};

πŸ“Š Power Consumption Targets

Variant Power (Watts) Battery Life Performance
Maximum Performance 15W 2 hours 100%
Balanced 8W 4 hours 80%
Power Saver 3W 10 hours 50%

Status: ⏸️ Useful for mobile/laptop Priority: LOW - Nice to have