forked from facebookresearch/SparseConvNet
-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
39 lines (35 loc) · 1.56 KB
/
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
33
34
35
36
37
38
39
# Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch, os
from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension
from setuptools import setup, find_packages
this_dir = os.path.dirname(os.path.realpath(__file__))
torch_dir = os.path.dirname(torch.__file__)
conda_include_dir = '/'.join(torch_dir.split('/')[:-4]) + '/include'
extra = {'cxx': ['-std=c++11', '-fopenmp'], 'nvcc': ['-std=c++11', '-Xcompiler', '-fopenmp']}
setup(
name='sparseconvnet',
version='0.2',
description='Submanifold (Spatially) Sparse Convolutional Networks https://arxiv.org/abs/1706.01307',
author='Facebook AI Research',
author_email='benjamingraham@fb.com',
url='https://github.com/facebookresearch/SparseConvNet',
packages=['sparseconvnet','sparseconvnet.SCN'],
ext_modules=[
CUDAExtension('sparseconvnet.SCN',
[
'sparseconvnet/SCN/cuda.cu', 'sparseconvnet/SCN/sparseconvnet_cuda.cpp', 'sparseconvnet/SCN/pybind.cpp'],
include_dirs=[conda_include_dir, this_dir+'/sparseconvnet/SCN/'],
extra_compile_args=extra)
# if torch.cuda.is_available() else
# CppExtension('sparseconvnet.SCN',
# ['sparseconvnet/SCN/pybind.cpp', 'sparseconvnet/SCN/sparseconvnet_cpu.cpp'],
# include_dirs=[conda_include_dir, this_dir+'/sparseconvnet/SCN/'],
# extra_compile_args=extra['cxx'])],
],
cmdclass={'build_ext': BuildExtension},
zip_safe=False,
)