Skip to content

Commit 2984f28

Browse files
authored
Merge pull request #32 from 130ndim/master
Added flag for CPU install
2 parents e8aa000 + 61b9c55 commit 2984f28

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import platform
22
from setuptools import setup, find_packages
3+
from sys import argv
34
import torch
45
from torch.utils.cpp_extension import CppExtension, CUDAExtension, CUDA_HOME
56

@@ -16,7 +17,13 @@
1617
]
1718
cmdclass = {'build_ext': torch.utils.cpp_extension.BuildExtension}
1819

19-
if CUDA_HOME is not None:
20+
GPU = True
21+
for arg in argv:
22+
if arg == '--cpu':
23+
GPU = False
24+
argv.remove(arg)
25+
26+
if CUDA_HOME is not None and GPU:
2027
if platform.system() == 'Windows':
2128
extra_link_args = ['cusparse.lib']
2229
else:

0 commit comments

Comments
 (0)