-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
31 lines (29 loc) · 1020 Bytes
/
setup.py
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
27
28
29
30
31
#python3 setup.py install
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
import os
from distutils.sysconfig import get_config_vars
(opt,) = get_config_vars('OPT')
os.environ['OPT'] = " ".join(
flag for flag in opt.split() if flag != '-Wstrict-prototypes'
)
setup(
name='sptr',
version="1.0.0",
packages=find_packages(),
ext_modules=[
CUDAExtension('sptr_cuda', [
'src/sptr/pointops_api.cpp',
'src/sptr/attention/attention_cuda.cpp',
'src/sptr/attention/attention_cuda_kernel.cu',
'src/sptr/precompute/precompute.cpp',
'src/sptr/precompute/precompute_cuda_kernel.cu',
'src/sptr/rpe/relative_pos_encoding_cuda.cpp',
'src/sptr/rpe/relative_pos_encoding_cuda_kernel.cu',
],
extra_compile_args={'cxx': ['-g', '-O3'], 'nvcc': ['-O3']}
)
],
cmdclass={'build_ext': BuildExtension},
python_requires='>=3.8',
)