-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathsetup.py
More file actions
28 lines (26 loc) · 917 Bytes
/
setup.py
File metadata and controls
28 lines (26 loc) · 917 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
27
28
#python3 setup.py install
from setuptools import setup
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',
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'], 'nvcc': ['-O2']}
)
],
cmdclass={'build_ext': BuildExtension}
)