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
8068c5a6
Commit
8068c5a6
authored
Sep 17, 2018
by
Paul
Browse files
Formatting
parent
5775b579
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
src/program.cpp
src/program.cpp
+9
-7
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+1
-1
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+2
-2
No files found.
src/program.cpp
View file @
8068c5a6
...
@@ -318,17 +318,19 @@ argument generic_eval(const program& p,
...
@@ -318,17 +318,19 @@ argument generic_eval(const program& p,
argument
program
::
eval
(
std
::
unordered_map
<
std
::
string
,
argument
>
params
)
const
argument
program
::
eval
(
std
::
unordered_map
<
std
::
string
,
argument
>
params
)
const
{
{
if
(
enabled
(
MIGRAPH_TRACE_EVAL
{}))
{
if
(
enabled
(
MIGRAPH_TRACE_EVAL
{}))
auto
&
ctx
=
this
->
impl
->
ctx
;
{
return
generic_eval
(
*
this
,
this
->
impl
->
ctx
,
std
::
move
(
params
),
[
&
](
auto
&
ins
,
auto
f
)
{
auto
&
ctx
=
this
->
impl
->
ctx
;
return
generic_eval
(
*
this
,
this
->
impl
->
ctx
,
std
::
move
(
params
),
[
&
](
auto
&
ins
,
auto
f
)
{
ctx
.
finish
();
ctx
.
finish
();
std
::
cout
<<
"Run instruction: "
<<
ins
->
name
()
<<
std
::
endl
;
std
::
cout
<<
"Run instruction: "
<<
ins
->
name
()
<<
std
::
endl
;
return
f
();
return
f
();
});
});
}
}
else
{
else
return
generic_eval
(
*
this
,
this
->
impl
->
ctx
,
std
::
move
(
params
),
[](
auto
&
,
auto
f
)
{
return
f
();
});
{
return
generic_eval
(
*
this
,
this
->
impl
->
ctx
,
std
::
move
(
params
),
[](
auto
&
,
auto
f
)
{
return
f
();
});
}
}
}
}
...
...
src/targets/gpu/lowering.cpp
View file @
8068c5a6
...
@@ -438,7 +438,7 @@ struct miopen_apply
...
@@ -438,7 +438,7 @@ struct miopen_apply
instruction_ref
apply_softmax
(
instruction_ref
ins
)
instruction_ref
apply_softmax
(
instruction_ref
ins
)
{
{
auto
&&
op
=
any_cast
<
softmax
>
(
ins
->
get_operator
());
auto
&&
op
=
any_cast
<
softmax
>
(
ins
->
get_operator
());
auto
output
=
insert_allocation
(
ins
,
ins
->
get_shape
());
auto
output
=
insert_allocation
(
ins
,
ins
->
get_shape
());
return
prog
->
replace_instruction
(
ins
,
miopen_softmax
{
op
},
ins
->
inputs
().
at
(
0
),
output
);
return
prog
->
replace_instruction
(
ins
,
miopen_softmax
{
op
},
ins
->
inputs
().
at
(
0
),
output
);
}
}
...
...
test/gpu/miopen.cpp
View file @
8068c5a6
...
@@ -240,7 +240,7 @@ struct test_softmax
...
@@ -240,7 +240,7 @@ struct test_softmax
migraph
::
program
create_program
()
const
migraph
::
program
create_program
()
const
{
{
migraph
::
program
p
;
migraph
::
program
p
;
auto
x
=
p
.
add_parameter
(
"x"
,
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
5
,
3
,
4
,
2
}});
auto
x
=
p
.
add_parameter
(
"x"
,
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
5
,
3
,
4
,
2
}});
p
.
add_instruction
(
migraph
::
softmax
{},
x
);
p
.
add_instruction
(
migraph
::
softmax
{},
x
);
return
p
;
return
p
;
}
}
...
@@ -251,7 +251,7 @@ struct test_softmax2
...
@@ -251,7 +251,7 @@ struct test_softmax2
migraph
::
program
create_program
()
const
migraph
::
program
create_program
()
const
{
{
migraph
::
program
p
;
migraph
::
program
p
;
auto
x
=
p
.
add_parameter
(
"x"
,
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
1
,
1000
}});
auto
x
=
p
.
add_parameter
(
"x"
,
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
1
,
1000
}});
p
.
add_instruction
(
migraph
::
softmax
{},
x
);
p
.
add_instruction
(
migraph
::
softmax
{},
x
);
return
p
;
return
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