diff --git a/cuda_core/setup.py b/cuda_core/setup.py index 9b284bf..862d38d 100644 --- a/cuda_core/setup.py +++ b/cuda_core/setup.py @@ -2,8 +2,11 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +import os + from Cython.Build import cythonize from setuptools import setup, Extension, find_packages +from setuptools.command.build_ext import build_ext as _build_ext ext_modules = ( @@ -25,6 +28,13 @@ ) +class build_ext(_build_ext): + + def build_extensions(self): + self.parallel = os.cpu_count() // 2 + super().build_extensions() + + setup( ext_modules=cythonize(ext_modules, verbose=True, language_level=3, @@ -34,5 +44,6 @@ find_packages(include=["cuda.core.*"]), ["*.pxd", "*.pyx", "*.py"], ), + cmdclass = {'build_ext': build_ext,}, zip_safe=False, )