Skip to content

Commit b51c22a

Browse files
committed
USE_GPU
1 parent 80a7dc5 commit b51c22a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

setup.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
import torch
88
from torch.utils.cpp_extension import CppExtension, CUDAExtension, CUDA_HOME
99

10-
USE_GPU = True
11-
if '--cpu' in argv:
12-
USE_GPU = False
13-
1410
cxx_extra_compile_args = []
1511
nvcc_extra_compile_args = ['-arch=sm_35', '--expt-relaxed-constexpr']
1612
if platform.system() != 'Windows':
@@ -30,7 +26,7 @@
3026
extra_compile_args=cxx_extra_compile_args) for ext in exts
3127
]
3228

33-
if CUDA_HOME is not None and USE_GPU:
29+
if CUDA_HOME is not None and '--cpu' not in argv:
3430
exts = [e.split(osp.sep)[-1][:-4] for e in glob(osp.join('cuda', '*.cpp'))]
3531
ext_modules += [
3632
CUDAExtension(

0 commit comments

Comments
 (0)