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-cluster
Commits
193136fd
Commit
193136fd
authored
Feb 14, 2020
by
rusty1s
Browse files
move files
parent
0194ebb6
Changes
30
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
58 additions
and
56 deletions
+58
-56
csrc/cuda/nearest.cpp
csrc/cuda/nearest.cpp
+0
-0
csrc/cuda/nearest_kernel.cu
csrc/cuda/nearest_kernel.cu
+0
-0
csrc/cuda/proposal.cuh
csrc/cuda/proposal.cuh
+0
-0
csrc/cuda/radius.cpp
csrc/cuda/radius.cpp
+0
-0
csrc/cuda/radius_kernel.cu
csrc/cuda/radius_kernel.cu
+0
-0
csrc/cuda/response.cuh
csrc/cuda/response.cuh
+0
-0
csrc/cuda/rw.cpp
csrc/cuda/rw.cpp
+0
-0
csrc/cuda/rw_kernel.cu
csrc/cuda/rw_kernel.cu
+0
-0
csrc/cuda/utils.cuh
csrc/cuda/utils.cuh
+0
-0
setup.py
setup.py
+58
-56
No files found.
cuda/nearest.cpp
→
csrc/
cuda/nearest.cpp
View file @
193136fd
File moved
cuda/nearest_kernel.cu
→
csrc/
cuda/nearest_kernel.cu
View file @
193136fd
File moved
cuda/proposal.cuh
→
csrc/
cuda/proposal.cuh
View file @
193136fd
File moved
cuda/radius.cpp
→
csrc/
cuda/radius.cpp
View file @
193136fd
File moved
cuda/radius_kernel.cu
→
csrc/
cuda/radius_kernel.cu
View file @
193136fd
File moved
cuda/response.cuh
→
csrc/
cuda/response.cuh
View file @
193136fd
File moved
cuda/rw.cpp
→
csrc/
cuda/rw.cpp
View file @
193136fd
File moved
cuda/rw_kernel.cu
→
csrc/
cuda/rw_kernel.cu
View file @
193136fd
File moved
cuda/utils.cuh
→
csrc/
cuda/utils.cuh
View file @
193136fd
File moved
setup.py
View file @
193136fd
import
os
import
os.path
as
osp
import
glob
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
from
sys
import
argv
import
torch
import
torch
from
torch.utils.cpp_extension
import
BuildExtension
from
torch.utils.cpp_extension
import
CppExtension
,
CUDAExtension
,
CUDA_HOME
from
torch.utils.cpp_extension
import
CppExtension
,
CUDAExtension
,
CUDA_HOME
TORCH_MAJOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
0
])
WITH_CUDA
=
torch
.
cuda
.
is_available
()
and
CUDA_HOME
is
not
None
TORCH_MINOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
1
])
if
os
.
getenv
(
'FORCE_CUDA'
,
'0'
)
==
'1'
:
WITH_CUDA
=
True
if
os
.
getenv
(
'FORCE_CPU'
,
'0'
)
==
'1'
:
WITH_CUDA
=
False
BUILD_DOCS
=
os
.
getenv
(
'BUILD_DOCS'
,
'0'
)
==
'1'
def
get_extensions
():
Extension
=
CppExtension
define_macros
=
[]
extra_compile_args
=
{
'cxx'
:
[]}
if
WITH_CUDA
:
Extension
=
CUDAExtension
define_macros
+=
[(
'WITH_CUDA'
,
None
)]
nvcc_flags
=
os
.
getenv
(
'NVCC_FLAGS'
,
''
)
nvcc_flags
=
[]
if
nvcc_flags
==
''
else
nvcc_flags
.
split
(
' '
)
nvcc_flags
+=
[
'-arch=sm_35'
,
'--expt-relaxed-constexpr'
]
extra_compile_args
[
'nvcc'
]
=
nvcc_flags
extensions_dir
=
osp
.
join
(
osp
.
dirname
(
osp
.
abspath
(
__file__
)),
'csrc'
)
main_files
=
glob
.
glob
(
osp
.
join
(
extensions_dir
,
'*.cpp'
))
extensions
=
[]
for
main
in
main_files
:
name
=
main
.
split
(
os
.
sep
)[
-
1
][:
-
4
]
extra_compile_args
=
[]
sources
=
[
main
]
if
(
TORCH_MAJOR
>
1
)
or
(
TORCH_MAJOR
==
1
and
TORCH_MINOR
>
2
):
extra_compile_args
+=
[
'-DVERSION_GE_1_3'
]
ext_modules
=
[
path
=
osp
.
join
(
extensions_dir
,
'cpu'
,
f
'
{
name
}
_cpu.cpp'
)
CppExtension
(
'torch_cluster.graclus_cpu'
,
[
'cpu/graclus.cpp'
],
if
osp
.
exists
(
path
):
extra_compile_args
=
extra_compile_args
),
sources
+=
[
path
]
CppExtension
(
'torch_cluster.grid_cpu'
,
[
'cpu/grid.cpp'
]),
CppExtension
(
'torch_cluster.fps_cpu'
,
[
'cpu/fps.cpp'
],
extra_compile_args
=
extra_compile_args
),
CppExtension
(
'torch_cluster.rw_cpu'
,
[
'cpu/rw.cpp'
],
extra_compile_args
=
extra_compile_args
),
CppExtension
(
'torch_cluster.sampler_cpu'
,
[
'cpu/sampler.cpp'
],
extra_compile_args
=
extra_compile_args
),
]
cmdclass
=
{
'build_ext'
:
torch
.
utils
.
cpp_extension
.
BuildExtension
}
GPU
=
True
path
=
osp
.
join
(
extensions_dir
,
'cuda'
,
f
'
{
name
}
_cuda.cu'
)
for
arg
in
argv
:
if
WITH_CUDA
and
osp
.
exists
(
path
):
if
arg
==
'--cpu'
:
sources
+=
[
path
]
GPU
=
False
argv
.
remove
(
arg
)
if
CUDA_HOME
is
not
None
and
GPU
:
extension
=
Extension
(
ext_modules
+=
[
'torch_cluster._'
+
name
,
CUDAExtension
(
'torch_cluster.graclus_cuda'
,
sources
,
[
'cuda/graclus.cpp'
,
'cuda/graclus_kernel.cu'
],
include_dirs
=
[
extensions_dir
],
extra_compile_args
=
extra_compile_args
),
define_macros
=
define_macros
,
CUDAExtension
(
'torch_cluster.grid_cuda'
,
extra_compile_args
=
extra_compile_args
,
[
'cuda/grid.cpp'
,
'cuda/grid_kernel.cu'
],
)
extra_compile_args
=
extra_compile_args
),
extensions
+=
[
extension
]
CUDAExtension
(
'torch_cluster.fps_cuda'
,
[
'cuda/fps.cpp'
,
'cuda/fps_kernel.cu'
],
return
extensions
extra_compile_args
=
extra_compile_args
),
CUDAExtension
(
'torch_cluster.nearest_cuda'
,
[
'cuda/nearest.cpp'
,
'cuda/nearest_kernel.cu'
],
extra_compile_args
=
extra_compile_args
),
CUDAExtension
(
'torch_cluster.knn_cuda'
,
[
'cuda/knn.cpp'
,
'cuda/knn_kernel.cu'
],
extra_compile_args
=
extra_compile_args
),
CUDAExtension
(
'torch_cluster.radius_cuda'
,
[
'cuda/radius.cpp'
,
'cuda/radius_kernel.cu'
],
extra_compile_args
=
extra_compile_args
),
CUDAExtension
(
'torch_cluster.rw_cuda'
,
[
'cuda/rw.cpp'
,
'cuda/rw_kernel.cu'
],
extra_compile_args
=
extra_compile_args
),
]
__version__
=
'1.4.5'
url
=
'https://github.com/rusty1s/pytorch_cluster'
install_requires
=
[
'scipy'
]
install_requires
=
[
'scipy'
]
setup_requires
=
[
'pytest-runner'
]
setup_requires
=
[
'pytest-runner'
]
...
@@ -63,23 +63,25 @@ tests_require = ['pytest', 'pytest-cov']
...
@@ -63,23 +63,25 @@ tests_require = ['pytest', 'pytest-cov']
setup
(
setup
(
name
=
'torch_cluster'
,
name
=
'torch_cluster'
,
version
=
__version__
,
version
=
'1.5.0'
,
description
=
(
'PyTorch Extension Library of Optimized Graph Cluster '
'Algorithms'
),
author
=
'Matthias Fey'
,
author
=
'Matthias Fey'
,
author_email
=
'matthias.fey@tu-dortmund.de'
,
author_email
=
'matthias.fey@tu-dortmund.de'
,
url
=
url
,
url
=
'https://github.com/rusty1s/pytorch_cluster'
,
download_url
=
'{}/archive/{}.tar.gz'
.
format
(
url
,
__version__
),
description
=
(
'PyTorch Extension Library of Optimized Graph Cluster '
'Algorithms'
),
keywords
=
[
keywords
=
[
'pytorch'
,
'pytorch'
,
'geometric-deep-learning'
,
'geometric-deep-learning'
,
'graph-neural-networks'
,
'graph-neural-networks'
,
'cluster-algorithms'
,
'cluster-algorithms'
,
],
],
license
=
'MIT'
,
install_requires
=
install_requires
,
install_requires
=
install_requires
,
setup_requires
=
setup_requires
,
setup_requires
=
setup_requires
,
tests_require
=
tests_require
,
tests_require
=
tests_require
,
ext_modules
=
ext_modules
,
ext_modules
=
get_extensions
()
if
not
BUILD_DOCS
else
[],
cmdclass
=
cmdclass
,
cmdclass
=
{
'build_ext'
:
BuildExtension
.
with_options
(
no_python_abi_suffix
=
True
)
},
packages
=
find_packages
(),
packages
=
find_packages
(),
)
)
Prev
1
2
Next
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