Skip to content

Commit bdfb15a

Browse files
committed
fix: cpu power for ultra chips #17
1 parent 47c36f7 commit bdfb15a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
22
/target
33
/internal
4-
__handlers__/
4+
__handlers__/
5+
samples/

src/metrics.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,10 @@ impl Sampler {
249249

250250
if x.group == "Energy Model" {
251251
match x.channel.as_str() {
252-
"CPU Energy" => rs.cpu_power += cfio_watts(x.item, &x.unit, dt)?,
253252
"GPU Energy" => rs.gpu_power += cfio_watts(x.item, &x.unit, dt)?,
253+
// "CPU Energy" for Basic / Max, "DIE_{}_CPU Energy" for Ultra
254+
c if c.ends_with("CPU Energy") => rs.cpu_power += cfio_watts(x.item, &x.unit, dt)?,
255+
// same pattern next keys: "ANE" for Basic, "ANE0" for Max, "ANE0_{}" for Ultra
254256
c if c.starts_with("ANE") => rs.ane_power += cfio_watts(x.item, &x.unit, dt)?,
255257
c if c.starts_with("DRAM") => rs.ram_power += cfio_watts(x.item, &x.unit, dt)?,
256258
c if c.starts_with("GPU SRAM") => rs.gpu_ram_power += cfio_watts(x.item, &x.unit, dt)?,

0 commit comments

Comments
 (0)