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
4aff18c1
Commit
4aff18c1
authored
Jun 19, 2018
by
Paul
Browse files
Formatting
parent
c044272e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
26 deletions
+8
-26
src/targets/cpu/cpu_target.cpp
src/targets/cpu/cpu_target.cpp
+8
-26
No files found.
src/targets/cpu/cpu_target.cpp
View file @
4aff18c1
...
@@ -57,29 +57,17 @@ struct cpu_convolution
...
@@ -57,29 +57,17 @@ struct cpu_convolution
struct
max_pool
struct
max_pool
{
{
static
std
::
string
name
()
{
return
"max"
;
}
static
std
::
string
name
()
{
return
"max"
;
}
static
double
start
()
static
double
start
()
{
return
std
::
numeric_limits
<
double
>::
lowest
();
}
{
return
std
::
numeric_limits
<
double
>::
lowest
();
}
static
double
apply
(
double
x
,
double
y
)
static
double
apply
(
double
x
,
double
y
)
{
return
x
+
y
;
}
{
return
x
+
y
;
}
static
double
final
(
double
x
,
double
)
static
double
final
(
double
x
,
double
)
{
return
(
x
);
}
{
return
(
x
);
}
};
};
struct
avg_pool
struct
avg_pool
{
{
static
std
::
string
name
()
{
return
"average"
;
}
static
std
::
string
name
()
{
return
"average"
;
}
static
double
start
()
static
double
start
()
{
return
0.0
;
}
{
return
0.0
;
}
static
double
apply
(
double
x
,
double
y
)
static
double
apply
(
double
x
,
double
y
)
{
{
...
@@ -87,14 +75,10 @@ struct avg_pool
...
@@ -87,14 +75,10 @@ struct avg_pool
return
(
m
);
return
(
m
);
}
}
static
double
final
(
double
x
,
double
y
)
static
double
final
(
double
x
,
double
y
)
{
return
x
/
y
;
}
{
return
x
/
y
;
}
};
};
template
<
class
Op
>
template
<
class
Op
>
struct
cpu_pooling
struct
cpu_pooling
{
{
pooling
op
;
pooling
op
;
...
@@ -127,7 +111,6 @@ struct cpu_pooling
...
@@ -127,7 +111,6 @@ struct cpu_pooling
const
int
w_w
=
(
wend
-
start_y
);
const
int
w_w
=
(
wend
-
start_y
);
const
int
pool_size
=
std
::
max
(
w_h
*
w_w
,
1
);
const
int
pool_size
=
std
::
max
(
w_h
*
w_w
,
1
);
double
acc
=
Op
::
start
();
double
acc
=
Op
::
start
();
dfor
(
w_h
,
w_w
)([
&
](
int
x
,
int
y
)
{
dfor
(
w_h
,
w_w
)([
&
](
int
x
,
int
y
)
{
const
int
in_x
=
start_x
+
x
;
const
int
in_x
=
start_x
+
x
;
...
@@ -583,7 +566,6 @@ struct cpu_apply
...
@@ -583,7 +566,6 @@ struct cpu_apply
prog
->
replace_instruction
(
ins
,
cpu_pooling
<
max_pool
>
{
op
},
ins
->
arguments
);
prog
->
replace_instruction
(
ins
,
cpu_pooling
<
max_pool
>
{
op
},
ins
->
arguments
);
else
if
(
op
.
mode
==
"average"
)
else
if
(
op
.
mode
==
"average"
)
prog
->
replace_instruction
(
ins
,
cpu_pooling
<
avg_pool
>
{
op
},
ins
->
arguments
);
prog
->
replace_instruction
(
ins
,
cpu_pooling
<
avg_pool
>
{
op
},
ins
->
arguments
);
}
}
};
};
...
...
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