forked from NVIDIA/cuda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
26 lines (19 loc) · 630 Bytes
/
setup.py
File metadata and controls
26 lines (19 loc) · 630 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
import os
import build_hooks # our build backend
from setuptools import setup
from setuptools.command.build_ext import build_ext as _build_ext
nthreads = int(os.environ.get("CUDA_PYTHON_PARALLEL_LEVEL", os.cpu_count() // 2))
class build_ext(_build_ext):
def build_extensions(self):
self.parallel = nthreads
super().build_extensions()
setup(
ext_modules=build_hooks._extensions,
cmdclass={
"build_ext": build_ext,
},
zip_safe=False,
)