Solved issue with W suffix in GPU powerdraw

This commit is contained in:
Eduardo Cueto Mendoza 2020-07-28 11:59:11 -06:00
parent a615b58a7d
commit a3c3a69f0e
2 changed files with 8 additions and 5 deletions

View File

@ -1,7 +1,7 @@
name = "GreenFlux" name = "GreenFlux"
uuid = "ccad5352-7643-4eb2-b711-e9c298e87bf0" uuid = "ccad5352-7643-4eb2-b711-e9c298e87bf0"
authors = ["Eduardo Cueto Mendoza"] authors = ["Eduardo Cueto Mendoza"]
version = "0.1.0" version = "0.0.4"
[deps] [deps]
CUDAapi = "3895d2a7-ec45-59b8-82bb-cfc6a382f9b3" CUDAapi = "3895d2a7-ec45-59b8-82bb-cfc6a382f9b3"

View File

@ -34,17 +34,20 @@ function gpupowerdraw()
usagestr = "" usagestr = ""
capstr = "" capstr = ""
if g[5] == "N/A" if g[5] == "N/A"
usagestr = "0.0" usagestr = "0W"
else else
usagestr = usagestr * g[5] usagestr = usagestr * g[5]
end end
if g[7] == "N/A" if g[7] == "N/A"
capstr = "0.0" capstr = "0W"
else else
capstr = capstr * g[7] capstr = capstr * g[7]
end end
powerdraw = vcat(powerdraw, parse(Float64,usagestr)) regexw = r"(\d+)"
powercap = vcat(powercap, parse(Float64,capstr)) wattusg = match(regexw,usagestr)
wattcap = match(regexw,capstr)
powerdraw = vcat(powerdraw, parse(Float64,wattusg.match))
powercap = vcat(powercap, parse(Float64,wattcap.match))
end end
usage[count] = mean(powerdraw) usage[count] = mean(powerdraw)
cap[count] = mean(powercap) cap[count] = mean(powercap)