Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
09cee914
Commit
09cee914
authored
Feb 25, 2019
by
Shucai Xiao
Browse files
simplify the gpu gather implementation
parent
b466ceb9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
21 deletions
+12
-21
src/targets/gpu/device/gather.cpp
src/targets/gpu/device/gather.cpp
+12
-21
No files found.
src/targets/gpu/device/gather.cpp
View file @
09cee914
...
...
@@ -23,14 +23,6 @@ argument gather(hipStream_t stream,
const
auto
*
indices_ptr
=
device_cast
(
indices
.
data
());
auto
*
out_ptr
=
device_cast
(
output
.
data
());
const
auto
*
in_ptr
=
device_cast
(
input
.
data
());
if
(
output_shape
.
scalar
())
{
gs_launch
(
stream
,
1
)(
[
=
](
auto
i
)
{
out_ptr
[
i
]
=
in_ptr
[
static_cast
<
int
>
(
indices_ptr
[
0
])];
});
}
else
{
// if indices are a scalar, output has one dim smaller than input
auto
&
input_shape
=
args
[
0
].
get_shape
();
auto
lens
=
input_shape
.
lens
();
lens
[
axis_index
]
=
args
[
1
].
get_shape
().
elements
();
...
...
@@ -44,7 +36,6 @@ argument gather(hipStream_t stream,
out_ptr
[
ii
]
=
in_ptr
[
desc_input
.
linear
(
in_idx
)];
});
});
}
});
});
...
...
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