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
gaoqiong
MIGraphX
Commits
14d28cb3
Commit
14d28cb3
authored
Nov 05, 2023
by
Paul
Browse files
Format
parent
d92520de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
src/targets/gpu/jit/pad.cpp
src/targets/gpu/jit/pad.cpp
+11
-7
No files found.
src/targets/gpu/jit/pad.cpp
View file @
14d28cb3
...
@@ -71,20 +71,24 @@ struct pad_compiler : compiler<pad_compiler>
...
@@ -71,20 +71,24 @@ struct pad_compiler : compiler<pad_compiler>
std
::
copy
(
padding
.
begin
(),
padding
.
begin
()
+
offsets
.
size
(),
offsets
.
begin
());
std
::
copy
(
padding
.
begin
(),
padding
.
begin
()
+
offsets
.
size
(),
offsets
.
begin
());
auto
offset_lens
=
input_lens
;
auto
offset_lens
=
input_lens
;
std
::
transform
(
input_lens
.
begin
(),
input_lens
.
end
(),
offsets
.
begin
(),
offset_lens
.
begin
(),
[
&
](
auto
input
,
auto
offset
)
{
std
::
transform
(
input_lens
.
begin
(),
return
input
+
offset
;
input_lens
.
end
(),
});
offsets
.
begin
(),
offset_lens
.
begin
(),
[
&
](
auto
input
,
auto
offset
)
{
return
input
+
offset
;
});
auto
vinputs
=
inputs
;
auto
vinputs
=
inputs
;
vinputs
.
push_back
(
inputs
.
front
().
with_lens
(
offset_lens
));
vinputs
.
push_back
(
inputs
.
front
().
with_lens
(
offset_lens
));
auto
rinputs
=
reduce_dims
(
vinputs
);
auto
rinputs
=
reduce_dims
(
vinputs
);
auto
rinput_lens
=
rinputs
.
front
().
lens
();
auto
rinput_lens
=
rinputs
.
front
().
lens
();
auto
roffset_lens
=
rinputs
.
back
().
lens
();
auto
roffset_lens
=
rinputs
.
back
().
lens
();
std
::
vector
<
size_t
>
roffsets
(
roffset_lens
.
size
());
std
::
vector
<
size_t
>
roffsets
(
roffset_lens
.
size
());
std
::
transform
(
rinput_lens
.
begin
(),
rinput_lens
.
end
(),
roffset_lens
.
begin
(),
roffsets
.
begin
(),
[](
auto
input
,
auto
offset_dim
)
{
std
::
transform
(
rinput_lens
.
begin
(),
return
offset_dim
-
input
;
rinput_lens
.
end
(),
});
roffset_lens
.
begin
(),
roffsets
.
begin
(),
[](
auto
input
,
auto
offset_dim
)
{
return
offset_dim
-
input
;
});
rinputs
.
pop_back
();
rinputs
.
pop_back
();
hip_compile_options
options
;
hip_compile_options
options
;
...
...
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