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
d85bc4fb
Commit
d85bc4fb
authored
Aug 31, 2018
by
rusty1s
Browse files
voxel grid CUDA bugfix
parent
920cc934
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
18 deletions
+3
-18
cuda/cluster.cpp
cuda/cluster.cpp
+0
-15
cuda/grid_kernel.cu
cuda/grid_kernel.cu
+1
-1
setup.py
setup.py
+1
-1
torch_cluster/__init__.py
torch_cluster/__init__.py
+1
-1
No files found.
cuda/cluster.cpp
deleted
100644 → 0
View file @
920cc934
#include <torch/torch.h>
at
::
Tensor
grid
(
at
::
Tensor
pos
,
at
::
Tensor
size
,
at
::
Tensor
start
,
at
::
Tensor
end
);
at
::
Tensor
graclus
(
at
::
Tensor
row
,
at
::
Tensor
col
,
int
num_nodes
);
at
::
Tensor
weighted_graclus
(
at
::
Tensor
row
,
at
::
Tensor
col
,
at
::
Tensor
weight
,
int
num_nodes
);
PYBIND11_MODULE
(
TORCH_EXTENSION_NAME
,
m
)
{
m
.
def
(
"grid"
,
&
grid
,
"Grid (CUDA)"
);
m
.
def
(
"graclus"
,
&
graclus
,
"Graclus (CUDA)"
);
m
.
def
(
"weighted_graclus"
,
&
weighted_graclus
,
"Weightes Graclus (CUDA)"
);
}
cuda/grid_kernel.cu
View file @
d85bc4fb
...
...
@@ -18,7 +18,7 @@ __global__ void grid_kernel(int64_t *cluster,
for
(
ptrdiff_t
d
=
0
;
d
<
pos
.
sizes
[
1
];
d
++
)
{
scalar_t
p
=
pos
.
data
[
i
*
pos
.
strides
[
0
]
+
d
*
pos
.
strides
[
1
]]
-
start
[
d
];
c
+=
(
int64_t
)(
p
/
size
[
d
])
*
k
;
k
+
=
(
int64_t
)((
end
[
d
]
-
start
[
d
])
/
size
[
d
]);
k
*
=
(
int64_t
)((
end
[
d
]
-
start
[
d
])
/
size
[
d
])
+
1
;
}
cluster
[
i
]
=
c
;
}
...
...
setup.py
View file @
d85bc4fb
...
...
@@ -15,7 +15,7 @@ if torch.cuda.is_available():
CUDAExtension
(
'grid_cuda'
,
[
'cuda/grid.cpp'
,
'cuda/grid_kernel.cu'
]),
]
__version__
=
'1.1.
4
'
__version__
=
'1.1.
5
'
url
=
'https://github.com/rusty1s/pytorch_cluster'
install_requires
=
[]
...
...
torch_cluster/__init__.py
View file @
d85bc4fb
from
.graclus
import
graclus_cluster
from
.grid
import
grid_cluster
__version__
=
'1.1.
4
'
__version__
=
'1.1.
5
'
__all__
=
[
'graclus_cluster'
,
'grid_cluster'
,
'__version__'
]
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