Unverified Commit 5504b5fb authored by tangyanf's avatar tangyanf Committed by GitHub
Browse files

fix compile without cuda (#945)

parent cb0ee1e3
...@@ -257,7 +257,6 @@ def get_extensions(): ...@@ -257,7 +257,6 @@ def get_extensions():
include_path = os.path.abspath('./mmcv/ops/csrc/onnxruntime') include_path = os.path.abspath('./mmcv/ops/csrc/onnxruntime')
include_dirs.append(include_path) include_dirs.append(include_path)
include_dirs.append(os.path.join(ort_path, 'include')) include_dirs.append(os.path.join(ort_path, 'include'))
include_dirs += include_paths(cuda=True)
op_files = glob.glob('./mmcv/ops/csrc/onnxruntime/cpu/*') op_files = glob.glob('./mmcv/ops/csrc/onnxruntime/cpu/*')
if onnxruntime.get_device() == 'GPU' or os.getenv('FORCE_CUDA', if onnxruntime.get_device() == 'GPU' or os.getenv('FORCE_CUDA',
...@@ -266,8 +265,10 @@ def get_extensions(): ...@@ -266,8 +265,10 @@ def get_extensions():
cuda_args = os.getenv('MMCV_CUDA_ARGS') cuda_args = os.getenv('MMCV_CUDA_ARGS')
extra_compile_args['nvcc'] = [cuda_args] if cuda_args else [] extra_compile_args['nvcc'] = [cuda_args] if cuda_args else []
op_files += glob.glob('./mmcv/ops/csrc/onnxruntime/gpu/*') op_files += glob.glob('./mmcv/ops/csrc/onnxruntime/gpu/*')
include_dirs += include_paths(cuda=True)
library_dirs += library_paths(cuda=True) library_dirs += library_paths(cuda=True)
else: else:
include_dirs += include_paths(cuda=False)
library_dirs += library_paths(cuda=False) library_dirs += library_paths(cuda=False)
kwargs['library_dirs'] = library_dirs kwargs['library_dirs'] = library_dirs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment