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
de431201
Commit
de431201
authored
Mar 13, 2020
by
rusty1s
Browse files
fix nearest bug
parent
e1e47f9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
csrc/cuda/nearest_cuda.cu
csrc/cuda/nearest_cuda.cu
+5
-2
No files found.
csrc/cuda/nearest_cuda.cu
View file @
de431201
...
@@ -15,9 +15,12 @@ __global__ void nearest_kernel(const scalar_t *x, const scalar_t *y,
...
@@ -15,9 +15,12 @@ __global__ void nearest_kernel(const scalar_t *x, const scalar_t *y,
const
int64_t
n_x
=
blockIdx
.
x
;
const
int64_t
n_x
=
blockIdx
.
x
;
int64_t
batch_idx
;
int64_t
batch_idx
;
for
(
int64_t
b
=
0
;
b
<
batch_size
;
b
++
)
for
(
int64_t
b
=
0
;
b
<
batch_size
;
b
++
)
{
if
(
ptr_x
[
b
]
>=
n_x
and
ptr_x
[
b
+
1
]
<
n_x
)
if
(
n_x
>=
ptr_x
[
b
]
&&
n_x
<
ptr_x
[
b
+
1
]
)
{
batch_idx
=
b
;
batch_idx
=
b
;
continue
;
}
}
const
int64_t
y_start_idx
=
ptr_y
[
batch_idx
];
const
int64_t
y_start_idx
=
ptr_y
[
batch_idx
];
const
int64_t
y_end_idx
=
ptr_y
[
batch_idx
+
1
];
const
int64_t
y_end_idx
=
ptr_y
[
batch_idx
+
1
];
...
...
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