-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
27 lines (25 loc) · 883 Bytes
/
setup.py
File metadata and controls
27 lines (25 loc) · 883 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
# setup.py
from setuptools import setup, find_packages
import torch.cuda
from torch.utils.cpp_extension import CUDAExtension, BuildExtension
from torch.utils.cpp_extension import CUDA_HOME
# Set up CUDA extension if CUDA is available
ext_modules = []
if torch.cuda.is_available() and CUDA_HOME is not None:
extension = CUDAExtension(
'cauchy_mult', [
'extension/cauchy/cauchy.cpp',
'extension/cauchy/cauchy_cuda.cu',
],
extra_compile_args={'cxx': ['-g', '-march=native', '-funroll-loops'],
'nvcc': ['-O2', '-lineinfo', '--use_fast_math']}
)
ext_modules.append(extension)
setup(
name="SYNTHECG",
version="1.0",
packages=find_packages(),
ext_modules=ext_modules,
cmdclass={'build_ext': BuildExtension} if ext_modules else {},
zip_safe=False # Required for C extensions
)