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
ad9f1559
Commit
ad9f1559
authored
Jun 19, 2023
by
Artur Wojcik
Browse files
cpu_lowering
parent
e4891a4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
src/targets/cpu/lowering.cpp
src/targets/cpu/lowering.cpp
+3
-5
No files found.
src/targets/cpu/lowering.cpp
View file @
ad9f1559
...
@@ -122,11 +122,11 @@ struct cpu_im2col
...
@@ -122,11 +122,11 @@ struct cpu_im2col
const
std
::
size_t
col_height
=
(
height
-
kernel_h
+
2
*
pad_h
)
/
stride_h
+
1
;
const
std
::
size_t
col_height
=
(
height
-
kernel_h
+
2
*
pad_h
)
/
stride_h
+
1
;
const
std
::
size_t
col_width
=
(
width
-
kernel_w
+
2
*
pad_w
)
/
stride_w
+
1
;
const
std
::
size_t
col_width
=
(
width
-
kernel_w
+
2
*
pad_w
)
/
stride_w
+
1
;
// account for padding for the starting position of the input pixels
// account for padding for the starting position of the input pixels
long
iinput
=
kdiv2_h
-
long
(
pad_h
);
std
::
size_t
iinput
=
kdiv2_h
-
long
(
pad_h
);
// loop over output pixels (ioutput, joutput)
// loop over output pixels (ioutput, joutput)
for
(
std
::
size_t
ioutput
=
0
;
ioutput
<
col_height
;
ioutput
++
,
iinput
+=
stride_h
)
for
(
std
::
size_t
ioutput
=
0
;
ioutput
<
col_height
;
ioutput
++
,
iinput
+=
stride_h
)
{
{
long
jinput
=
kdiv2_w
-
long
(
pad_w
);
std
::
size_t
jinput
=
kdiv2_w
-
long
(
pad_w
);
for
(
std
::
size_t
joutput
=
0
;
joutput
<
col_width
;
joutput
++
,
jinput
+=
stride_w
)
for
(
std
::
size_t
joutput
=
0
;
joutput
<
col_width
;
joutput
++
,
jinput
+=
stride_w
)
{
{
// compute linear index for output
// compute linear index for output
...
@@ -137,9 +137,7 @@ struct cpu_im2col
...
@@ -137,9 +137,7 @@ struct cpu_im2col
kernel_w
)([
&
](
std
::
size_t
c
,
std
::
size_t
koffset
,
std
::
size_t
loffset
)
{
kernel_w
)([
&
](
std
::
size_t
c
,
std
::
size_t
koffset
,
std
::
size_t
loffset
)
{
auto
idx
=
iinput
+
long
(
koffset
)
-
kdiv2_h
;
auto
idx
=
iinput
+
long
(
koffset
)
-
kdiv2_h
;
auto
jdx
=
jinput
+
long
(
loffset
)
-
kdiv2_w
;
auto
jdx
=
jinput
+
long
(
loffset
)
-
kdiv2_w
;
col
(
ldx
,
p
)
=
((
idx
>=
0
)
&&
(
idx
<
height
)
&&
(
jdx
>=
0
)
&&
(
jdx
<
width
))
col
(
ldx
,
p
)
=
((
idx
<
height
)
&&
(
jdx
<
width
))
?
input
(
0
,
c
,
idx
,
jdx
)
:
0
;
?
input
(
0
,
c
,
idx
,
jdx
)
:
0
;
p
++
;
p
++
;
});
});
}
}
...
...
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