This repository was archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsetup.py
More file actions
50 lines (44 loc) · 1.28 KB
/
setup.py
File metadata and controls
50 lines (44 loc) · 1.28 KB
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
40
41
42
43
44
45
46
47
48
49
50
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from setuptools import setup, find_packages
from torch.utils.cpp_extension import (
CUDAExtension,
CUDA_HOME,
BuildExtension,
)
_DEBUG = False
_DEBUG_LEVEL = 0
# Common flags for both release and debug builds.
# extra_compile_args = sysconfig.get_config_var('CFLAGS').split()
# extra_compile_args = ["-std=c++17"]
extra_compile_args = []
extra_compile_args += ["-DNDEBUG", "-O3", "-lineinfo"]
extra_compile_args = {
'gcc': extra_compile_args,
'nvcc': [*extra_compile_args, "--ptxas-options=-v"]
}
modules = []
if CUDA_HOME:
modules.append(
CUDAExtension(
"deltacnn.cuda",
[
"src/cuda/common.cu",
"src/cuda/conv_torch_wrapper.cpp",
"src/cuda/conv_kernel.cu",
"src/cuda/deconv_kernel.cu",
"src/cuda/other_nn_layers.cu",
],
extra_compile_args=extra_compile_args,
language='c++17'
)
)
setup(
name="torchdeltacnn",
packages=find_packages(where="src"),
package_dir={"": "src"},
ext_modules=modules,
cmdclass={"build_ext": BuildExtension},
)