-
Notifications
You must be signed in to change notification settings - Fork 19
/
setup.py
32 lines (30 loc) · 990 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
32
"""
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""
import os
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
src_dir = 'Swin3D/src/attn'
src_files = [os.path.join(src_dir, _f) for _f in os.listdir(src_dir) if
os.path.splitext(_f)[1] in ['.cu', '.cpp']]
setup(
name='Swin3D',
packages=find_packages(exclude=[]),
ext_modules=[
CUDAExtension(
name='Swin3D.sparse_dl.attn_cuda',
sources=src_files,
extra_compile_args={'cxx': ['-g'],
'nvcc': ['-O2']}),
CUDAExtension(
name='Swin3D.sparse_dl.knn_cuda',
sources=[
'Swin3D/src/knn/knn_api.cpp',
'Swin3D/src/knn/knn_cuda_kernel.cu'],
extra_compile_args={'cxx': ['-g'],
'nvcc': ['-O2']}),
],
cmdclass={
'build_ext': BuildExtension
})