-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
32 lines (30 loc) · 812 Bytes
/
Copy pathsetup.py
File metadata and controls
32 lines (30 loc) · 812 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
29
30
31
32
from setuptools import setup
import torch
from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension
from warnings import warn
# TODO: always returns false
if True or torch.cuda.is_available():
ext_modules = [
CUDAExtension('recurrence_matrix', [
'src/recurrence.cpp',
'src/recurrence_kernel_gpu.cu',
])
]
else:
warn("CUDA not found: Using CPU version")
ext_modules = [
CppExtension('recurrence_matrix', [
'src/recurrence.cpp',
'src/recurrence_kernel_cpu.cpp',
])
]
setup(
name='recurrence_matrix',
version='1.0.0',
ext_modules=ext_modules,
install_requires=[
'torch'
],
cmdclass={
'build_ext': BuildExtension.with_options(use_ninja=False)
})