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
6bf96692
"...git@developer.sourcefind.cn:OpenDAS/torch-harmonics.git" did not exist on "780fd1435844b5ce672bfc40d0a83576e9e62824"
Commit
6bf96692
authored
Mar 13, 2020
by
rusty1s
Browse files
grid fixes
parent
06df4d9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
csrc/cuda/grid_cuda.cu
csrc/cuda/grid_cuda.cu
+4
-4
No files found.
csrc/cuda/grid_cuda.cu
View file @
6bf96692
...
@@ -16,7 +16,7 @@ __global__ void grid_kernel(const scalar_t *pos, const scalar_t *size,
...
@@ -16,7 +16,7 @@ __global__ void grid_kernel(const scalar_t *pos, const scalar_t *size,
if
(
thread_idx
<
numel
)
{
if
(
thread_idx
<
numel
)
{
int64_t
c
=
0
,
k
=
1
;
int64_t
c
=
0
,
k
=
1
;
for
(
int64_t
d
=
0
;
d
<
D
;
d
++
)
{
for
(
int64_t
d
=
0
;
d
<
D
;
d
++
)
{
scalar_t
p
=
pos
.
data
[
thread_idx
*
D
+
d
]
-
start
[
d
];
scalar_t
p
=
pos
[
thread_idx
*
D
+
d
]
-
start
[
d
];
c
+=
(
int64_t
)(
p
/
size
[
d
])
*
k
;
c
+=
(
int64_t
)(
p
/
size
[
d
])
*
k
;
k
*=
(
int64_t
)((
end
[
d
]
-
start
[
d
])
/
size
[
d
])
+
1
;
k
*=
(
int64_t
)((
end
[
d
]
-
start
[
d
])
/
size
[
d
])
+
1
;
}
}
...
@@ -24,9 +24,9 @@ __global__ void grid_kernel(const scalar_t *pos, const scalar_t *size,
...
@@ -24,9 +24,9 @@ __global__ void grid_kernel(const scalar_t *pos, const scalar_t *size,
}
}
}
}
torch
::
Tensor
grid_c
p
u
(
torch
::
Tensor
pos
,
torch
::
Tensor
size
,
torch
::
Tensor
grid_cu
da
(
torch
::
Tensor
pos
,
torch
::
Tensor
size
,
torch
::
optional
<
torch
::
Tensor
>
optional_start
,
torch
::
optional
<
torch
::
Tensor
>
optional_start
,
torch
::
optional
<
torch
::
Tensor
>
optional_end
)
{
torch
::
optional
<
torch
::
Tensor
>
optional_end
)
{
CHECK_CUDA
(
pos
);
CHECK_CUDA
(
pos
);
CHECK_CUDA
(
size
);
CHECK_CUDA
(
size
);
cudaSetDevice
(
pos
.
get_device
());
cudaSetDevice
(
pos
.
get_device
());
...
...
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