Skip to content

Commit 4ff4b5c

Browse files
committed
[SYCL] Use multiprocessing package to get cpu_count
os.cpu_count() is available only for Python3. Use multiprocessing package instead so that compile.py script works for both Python2 and Python3. Signed-off-by: Artur Gainullin <[email protected]>
1 parent 2551b19 commit 4ff4b5c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

buildbot/compile.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import argparse
2-
import os
2+
import multiprocessing
33
import subprocess
44
import sys
55

66
DEFAULT_CPU_COUNT = 4
77

88

99
def do_compile(args):
10-
cpu_count = os.cpu_count()
11-
if cpu_count is None:
10+
try:
11+
cpu_count = multiprocessing.cpu_count()
12+
except NotImplementedError:
1213
cpu_count = DEFAULT_CPU_COUNT
1314

1415
make_cmd = ["ninja", "-j", str(cpu_count), "deploy-sycl-toolchain", "deploy-opencl-aot"]

0 commit comments

Comments
 (0)