Skip to content

Commit 21cfeb8

Browse files
authored
intel mac support (#1503)
Signed-off-by: Luke Nezda <[email protected]>
1 parent 0a20f30 commit 21cfeb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

neural_compressor/utils/utility.py

+4
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ def get_number_of_sockets(self) -> int:
276276
cmd = "cat /proc/cpuinfo | grep 'physical id' | sort -u | wc -l"
277277
if psutil.WINDOWS:
278278
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"
279281

280282
with subprocess.Popen(
281283
args=cmd,
@@ -918,6 +920,8 @@ def get_number_of_sockets() -> int:
918920
cmd = "cat /proc/cpuinfo | grep 'physical id' | sort -u | wc -l"
919921
if sys.platform == "win32":
920922
cmd = 'wmic cpu get DeviceID | find /c "CPU"'
923+
elif sys.platform == "darwin": # pragma: no cover
924+
cmd = "sysctl -n machdep.cpu.core_count"
921925

922926
proc = subprocess.Popen(
923927
args=cmd,

0 commit comments

Comments
 (0)