Skip to content

Commit d1c42fb

Browse files
committed
windows support
1 parent c182d67 commit d1c42fb

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

setup.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import platform
12
from setuptools import setup, find_packages
23
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CUDA_HOME
34

@@ -11,12 +12,15 @@
1112
cmdclass = {}
1213

1314
if CUDA_HOME is not None:
15+
if platform.system() == 'Windows':
16+
extra_link_args = ['cusparse.lib'],
17+
else:
18+
extra_link_args = ['-lcusparse', '-l', 'cusparse'],
19+
1420
ext_modules += [
1521
CUDAExtension(
16-
'spspmm_cuda',
17-
['cuda/spspmm.cpp', 'cuda/spspmm_kernel.cu'],
18-
extra_link_args=['-lcusparse', '-l', 'cusparse'],
19-
),
22+
'spspmm_cuda', ['cuda/spspmm.cpp', 'cuda/spspmm_kernel.cu'],
23+
extra_link_args=extra_link_args),
2024
CUDAExtension('unique_cuda',
2125
['cuda/unique.cpp', 'cuda/unique_kernel.cu']),
2226
]
@@ -37,5 +41,4 @@
3741
tests_require=tests_require,
3842
ext_modules=ext_modules,
3943
cmdclass=cmdclass,
40-
packages=find_packages(),
41-
)
44+
packages=find_packages(), )

0 commit comments

Comments
 (0)