Skip to content

Commit 64c3a8e

Browse files
committed
enable parallel build
1 parent a41a4b7 commit 64c3a8e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cuda_core/setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
#
33
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
44

5+
import os
6+
57
from Cython.Build import cythonize
68
from setuptools import setup, Extension, find_packages
9+
from setuptools.command.build_ext import build_ext as _build_ext
710

811

912
ext_modules = (
@@ -25,6 +28,13 @@
2528
)
2629

2730

31+
class build_ext(_build_ext):
32+
33+
def build_extensions(self):
34+
self.parallel = os.cpu_count() // 2
35+
super().build_extensions()
36+
37+
2838
setup(
2939
ext_modules=cythonize(ext_modules,
3040
verbose=True, language_level=3,
@@ -34,5 +44,6 @@
3444
find_packages(include=["cuda.core.*"]),
3545
["*.pxd", "*.pyx", "*.py"],
3646
),
47+
cmdclass = {'build_ext': build_ext,},
3748
zip_safe=False,
3849
)

0 commit comments

Comments
 (0)