File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 22
22
from setuptools .command .build_ext import build_ext
23
23
from pkg_resources import packaging # type: ignore
24
24
25
- BUILD_SPLIT_CUDA = os .getenv ('BUILD_SPLIT_CUDA' )
26
25
IS_WINDOWS = sys .platform == 'win32'
27
26
LIB_EXT = '.pyd' if IS_WINDOWS else '.so'
28
27
EXEC_EXT = '.exe' if IS_WINDOWS else ''
28
+ CLIB_PREFIX = '' if IS_WINDOWS else 'lib'
29
+ CLIB_EXT = '.dll' if IS_WINDOWS else '.so'
29
30
SHARED_FLAG = '/DLL' if IS_WINDOWS else '-shared'
30
31
31
32
_HERE = os .path .abspath (__file__ )
32
33
_TORCH_PATH = os .path .dirname (os .path .dirname (_HERE ))
33
34
TORCH_LIB_PATH = os .path .join (_TORCH_PATH , 'lib' )
34
35
36
+
37
+ BUILD_SPLIT_CUDA = os .getenv ('BUILD_SPLIT_CUDA' ) or (os .path .exists (os .path .join (
38
+ TORCH_LIB_PATH , f'{ CLIB_PREFIX } torch_cuda_cu{ CLIB_EXT } ' )) and os .path .exists (os .path .join (TORCH_LIB_PATH , f'{ CLIB_PREFIX } torch_cuda_cpp{ CLIB_EXT } ' )))
39
+
35
40
# Taken directly from python stdlib < 3.9
36
41
# See https://github.com/pytorch/pytorch/issues/48617
37
42
def _nt_quote_args (args : Optional [List [str ]]) -> List [str ]:
You can’t perform that action at this time.
0 commit comments