File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1010from torch .utils .cpp_extension import BuildExtension
1111from torch .utils .cpp_extension import CppExtension , CUDAExtension , CUDA_HOME
1212
13+ major , minor = int (str (torch .__version__ )[0 ]), int (str (torch .__version__ )[2 ])
14+ use_ninja = major >= 2 or (major == 1 and minor >= 8 )
15+
1316WITH_CUDA = torch .cuda .is_available () and CUDA_HOME is not None
1417suffices = ['cpu' , 'cuda' ] if WITH_CUDA else ['cpu' ]
1518if os .getenv ('FORCE_CUDA' , '0' ) == '1' :
@@ -96,7 +99,8 @@ def get_extensions():
9699 ext_modules = get_extensions () if not BUILD_DOCS else [],
97100 cmdclass = {
98101 'build_ext' :
99- BuildExtension .with_options (no_python_abi_suffix = True , use_ninja = False )
102+ BuildExtension .with_options (no_python_abi_suffix = True ,
103+ use_ninja = use_ninja )
100104 },
101105 packages = find_packages (),
102106)
You can’t perform that action at this time.
0 commit comments