We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0a20f30 commit 21cfeb8Copy full SHA for 21cfeb8
neural_compressor/utils/utility.py
@@ -276,6 +276,8 @@ def get_number_of_sockets(self) -> int:
276
cmd = "cat /proc/cpuinfo | grep 'physical id' | sort -u | wc -l"
277
if psutil.WINDOWS:
278
cmd = r'wmic cpu get DeviceID | C:\Windows\System32\find.exe /C "CPU"'
279
+ elif psutil.MACOS: # pragma: no cover
280
+ cmd = "sysctl -n machdep.cpu.core_count"
281
282
with subprocess.Popen(
283
args=cmd,
@@ -918,6 +920,8 @@ def get_number_of_sockets() -> int:
918
920
919
921
if sys.platform == "win32":
922
cmd = 'wmic cpu get DeviceID | find /c "CPU"'
923
+ elif sys.platform == "darwin": # pragma: no cover
924
925
926
proc = subprocess.Popen(
927
0 commit comments