We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8aa000 commit 61b9c55Copy full SHA for 61b9c55
setup.py
@@ -1,5 +1,6 @@
1
import platform
2
from setuptools import setup, find_packages
3
+from sys import argv
4
import torch
5
from torch.utils.cpp_extension import CppExtension, CUDAExtension, CUDA_HOME
6
@@ -16,7 +17,13 @@
16
17
]
18
cmdclass = {'build_ext': torch.utils.cpp_extension.BuildExtension}
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:
27
if platform.system() == 'Windows':
28
extra_link_args = ['cusparse.lib']
29
else:
0 commit comments