Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-sparse
Commits
8b78601b
"docs/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "a9e4cea0cdb350de950b9bccd989fad19f826d8d"
Commit
8b78601b
authored
Jan 12, 2020
by
rusty1s
Browse files
generic install
parent
77bb0595
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
35 deletions
+24
-35
setup.py
setup.py
+24
-35
No files found.
setup.py
View file @
8b78601b
import
platform
import
platform
import
os.path
as
osp
from
glob
import
glob
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
from
sys
import
argv
from
sys
import
argv
import
torch
import
torch
from
torch.utils.cpp_extension
import
CppExtension
,
CUDAExtension
,
CUDA_HOME
from
torch.utils.cpp_extension
import
CppExtension
,
CUDAExtension
,
CUDA_HOME
cxx_extra_compile_args
=
[]
nvcc_extra_compile_args
=
[]
TORCH_MAJOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
0
])
TORCH_MAJOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
0
])
TORCH_MINOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
1
])
TORCH_MINOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
1
])
extra_compile_args
=
[]
extra_compile_args
=
[]
if
(
TORCH_MAJOR
>
1
)
or
(
TORCH_MAJOR
==
1
and
TORCH_MINOR
>
2
):
if
(
TORCH_MAJOR
>
1
)
or
(
TORCH_MAJOR
==
1
and
TORCH_MINOR
>
2
):
extra_compile_args
+=
[
'-DVERSION_GE_1_3'
]
cxx_extra_compile_args
+=
[
'-DVERSION_GE_1_3'
]
nvcc_extra_compile_args
+=
[
'-DVERSION_GE_1_3'
]
cmdclass
=
{
'build_ext'
:
torch
.
utils
.
cpp_extension
.
BuildExtension
}
ext_modules
=
[
ext_modules
=
[]
exts
=
[
e
.
split
(
osp
.
sep
)[
-
1
][:
-
4
]
for
e
in
glob
(
osp
.
join
(
'cpu'
,
'*.cpp'
))]
ext_modules
+=
[
CppExtension
(
CppExtension
(
'torch_sparse.spspmm_cpu'
,
f
'torch_sparse.
{
ext
}
_cpu'
,
[
f
'cpu/
{
ext
}
.cpp'
],
[
'cpu/spspmm.cpp'
],
extra_compile_args
=
cxx_extra_compile_args
)
for
ext
in
exts
extra_compile_args
=
extra_compile_args
,
),
]
]
cmdclass
=
{
'build_ext'
:
torch
.
utils
.
cpp_extension
.
BuildExtension
}
GPU
=
True
for
arg
in
argv
:
if
arg
==
'--cpu'
:
GPU
=
False
argv
.
remove
(
arg
)
if
CUDA_HOME
is
not
None
and
GPU
:
if
CUDA_HOME
is
not
None
and
'--cpu'
not
in
argv
:
if
platform
.
system
()
==
'Windows'
:
if
platform
.
system
()
==
'Windows'
:
extra_link_args
=
[
'cusparse.lib'
]
extra_link_args
=
[
'cusparse.lib'
]
else
:
else
:
extra_link_args
=
[
'-lcusparse'
,
'-l'
,
'cusparse'
]
extra_link_args
=
[
'-lcusparse'
,
'-l'
,
'cusparse'
]
exts
=
[
e
.
split
(
osp
.
sep
)[
-
1
][:
-
4
]
for
e
in
glob
(
osp
.
join
(
'cuda'
,
'*.cpp'
))]
ext_modules
+=
[
ext_modules
+=
[
CUDAExtension
(
CUDAExtension
(
'torch_sparse.spmm_cuda'
,
f
'torch_sparse.
{
ext
}
_cuda'
,
[
'cuda/spmm.cpp'
,
'cuda/spmm_kernel.cu'
],
[
f
'cuda/
{
ext
}
.cpp'
,
f
'cuda/
{
ext
}
_kernel.cu'
],
extra_compile_args
=
extra_compile_args
,
extra_compile_args
=
{
),
'cxx'
:
cxx_extra_compile_args
,
CUDAExtension
(
'nvcc'
:
nvcc_extra_compile_args
,
'torch_sparse.spspmm_cuda'
,
},
[
'cuda/spspmm.cpp'
,
'cuda/spspmm_kernel.cu'
],
extra_link_args
=
extra_link_args
,
extra_link_args
=
extra_link_args
,
extra_compile_args
=
extra_compile_args
,
)
for
ext
in
exts
),
CUDAExtension
(
'torch_sparse.unique_cuda'
,
[
'cuda/unique.cpp'
,
'cuda/unique_kernel.cu'
],
extra_compile_args
=
extra_compile_args
,
),
]
]
__version__
=
'0.4.3'
__version__
=
'0.4.3'
...
@@ -67,12 +61,7 @@ setup(
...
@@ -67,12 +61,7 @@ setup(
author_email
=
'matthias.fey@tu-dortmund.de'
,
author_email
=
'matthias.fey@tu-dortmund.de'
,
url
=
url
,
url
=
url
,
download_url
=
'{}/archive/{}.tar.gz'
.
format
(
url
,
__version__
),
download_url
=
'{}/archive/{}.tar.gz'
.
format
(
url
,
__version__
),
keywords
=
[
keywords
=
[
'pytorch'
,
'sparse'
,
'sparse-matrices'
,
'autograd'
],
'pytorch'
,
'sparse'
,
'sparse-matrices'
,
'autograd'
,
],
install_requires
=
install_requires
,
install_requires
=
install_requires
,
setup_requires
=
setup_requires
,
setup_requires
=
setup_requires
,
tests_require
=
tests_require
,
tests_require
=
tests_require
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment