MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / get_cpu_info

Function get_cpu_info

fastdeploy/collect_env.py:388–404  ·  view source on GitHub ↗
(run_lambda)

Source from the content-addressed store, hash-verified

386
387
388def get_cpu_info(run_lambda):
389 rc, out, err = 0, "", ""
390 if get_platform() == "linux":
391 rc, out, err = run_lambda("lscpu")
392 elif get_platform() == "win32":
393 rc, out, err = run_lambda(
394 "wmic cpu get Name,Manufacturer,Family,Architecture,ProcessorType,DeviceID, \
395 CurrentClockSpeed,MaxClockSpeed,L2CacheSize,L2CacheSpeed,Revision /VALUE"
396 )
397 elif get_platform() == "darwin":
398 rc, out, err = run_lambda("sysctl -n machdep.cpu.brand_string")
399 cpu_info = "None"
400 if rc == 0:
401 cpu_info = out
402 else:
403 cpu_info = err
404 return cpu_info
405
406
407def get_platform():

Callers 1

get_env_infoFunction · 0.85

Calls 1

get_platformFunction · 0.85

Tested by

no test coverage detected