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
2da3e1d0
Commit
2da3e1d0
authored
Jun 20, 2018
by
Paul
Browse files
Remove extra if statements
parent
df46bb45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
29 deletions
+5
-29
src/targets/cpu/cpu_target.cpp
src/targets/cpu/cpu_target.cpp
+5
-29
No files found.
src/targets/cpu/cpu_target.cpp
View file @
2da3e1d0
...
@@ -573,6 +573,9 @@ struct cpu_apply
...
@@ -573,6 +573,9 @@ struct cpu_apply
apply_map
[
"sin"
]
=
simple_op
<
cpu_unary
<
sin_op
>>
();
apply_map
[
"sin"
]
=
simple_op
<
cpu_unary
<
sin_op
>>
();
apply_map
[
"cos"
]
=
simple_op
<
cpu_unary
<
cos_op
>>
();
apply_map
[
"cos"
]
=
simple_op
<
cpu_unary
<
cos_op
>>
();
apply_map
[
"tan"
]
=
simple_op
<
cpu_unary
<
tan_op
>>
();
apply_map
[
"tan"
]
=
simple_op
<
cpu_unary
<
tan_op
>>
();
apply_map
[
"sub"
]
=
simple_op
<
cpu_binary
<
sub_op
>>
();
apply_map
[
"mul"
]
=
simple_op
<
cpu_binary
<
mul_op
>>
();
apply_map
[
"div"
]
=
simple_op
<
cpu_binary
<
div_op
>>
();
apply_map
[
"softmax"
]
=
simple_op
<
softmax2d
>
();
apply_map
[
"softmax"
]
=
simple_op
<
softmax2d
>
();
}
}
...
@@ -590,25 +593,13 @@ struct cpu_apply
...
@@ -590,25 +593,13 @@ struct cpu_apply
{
{
apply_pooling
(
it
);
apply_pooling
(
it
);
}
}
else
if
(
apply_map
.
count
(
it
->
op
.
name
())
>
0
)
{
apply_map
.
at
(
it
->
op
.
name
())(
it
);
}
else
if
(
it
->
op
.
name
()
==
"add"
)
else
if
(
it
->
op
.
name
()
==
"add"
)
{
{
apply_add
(
it
);
apply_add
(
it
);
}
}
else
if
(
it
->
op
.
name
()
==
"sub"
)
else
if
(
apply_map
.
count
(
it
->
op
.
name
())
>
0
)
{
apply_sub
(
it
);
}
else
if
(
it
->
op
.
name
()
==
"mul"
)
{
apply_mul
(
it
);
}
else
if
(
it
->
op
.
name
()
==
"div"
)
{
{
apply_
div
(
it
);
apply_
map
.
at
(
it
->
op
.
name
())
(
it
);
}
}
}
}
}
}
...
@@ -648,21 +639,6 @@ struct cpu_apply
...
@@ -648,21 +639,6 @@ struct cpu_apply
// prog->replace_instruction(ins, cpu_binary<add_op>{}, ins->arguments);
// prog->replace_instruction(ins, cpu_binary<add_op>{}, ins->arguments);
prog
->
replace_instruction
(
ins
,
add_with_broadcast
{
op
},
ins
->
arguments
);
prog
->
replace_instruction
(
ins
,
add_with_broadcast
{
op
},
ins
->
arguments
);
}
}
void
apply_sub
(
instruction_ref
ins
)
{
prog
->
replace_instruction
(
ins
,
cpu_binary
<
sub_op
>
{},
ins
->
arguments
);
}
void
apply_mul
(
instruction_ref
ins
)
{
prog
->
replace_instruction
(
ins
,
cpu_binary
<
mul_op
>
{},
ins
->
arguments
);
}
void
apply_div
(
instruction_ref
ins
)
{
prog
->
replace_instruction
(
ins
,
cpu_binary
<
div_op
>
{},
ins
->
arguments
);
}
};
};
std
::
string
cpu_target
::
name
()
const
{
return
"cpu"
;
}
std
::
string
cpu_target
::
name
()
const
{
return
"cpu"
;
}
...
...
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