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
cd07476b
"configs/datasets/vscode:/vscode.git/clone" did not exist on "e9cdb24dddde3419ae490a649cff9d79947ed45c"
Commit
cd07476b
authored
Aug 03, 2018
by
Paul
Browse files
Formatting
parent
b546a9f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/program.cpp
src/program.cpp
+2
-2
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+3
-3
No files found.
src/program.cpp
View file @
cd07476b
...
@@ -118,11 +118,11 @@ shape program::get_parameter_shape(std::string name)
...
@@ -118,11 +118,11 @@ shape program::get_parameter_shape(std::string name)
std
::
unordered_map
<
std
::
string
,
shape
>
program
::
get_parameter_shapes
()
const
std
::
unordered_map
<
std
::
string
,
shape
>
program
::
get_parameter_shapes
()
const
{
{
std
::
unordered_map
<
std
::
string
,
shape
>
result
;
std
::
unordered_map
<
std
::
string
,
shape
>
result
;
for
(
auto
&&
ins
:
impl
->
instructions
)
for
(
auto
&&
ins
:
impl
->
instructions
)
{
{
if
(
ins
.
op
.
name
()
==
"@param"
)
if
(
ins
.
op
.
name
()
==
"@param"
)
{
{
auto
&&
name
=
any_cast
<
builtin
::
param
>
(
ins
.
op
).
parameter
;
auto
&&
name
=
any_cast
<
builtin
::
param
>
(
ins
.
op
).
parameter
;
result
[
name
]
=
ins
.
result
;
result
[
name
]
=
ins
.
result
;
}
}
}
}
...
...
test/gpu/miopen.cpp
View file @
cd07476b
...
@@ -20,7 +20,7 @@ migraph::argument run_cpu()
...
@@ -20,7 +20,7 @@ migraph::argument run_cpu()
auto
p
=
v
.
create_program
();
auto
p
=
v
.
create_program
();
p
.
compile
(
migraph
::
cpu
::
cpu_target
{});
p
.
compile
(
migraph
::
cpu
::
cpu_target
{});
migraph
::
program
::
parameter_map
m
;
migraph
::
program
::
parameter_map
m
;
for
(
auto
&&
x
:
p
.
get_parameter_shapes
())
for
(
auto
&&
x
:
p
.
get_parameter_shapes
())
{
{
m
[
x
.
first
]
=
migraph
::
generate_argument
(
x
.
second
);
m
[
x
.
first
]
=
migraph
::
generate_argument
(
x
.
second
);
}
}
...
@@ -35,9 +35,9 @@ migraph::argument run_gpu()
...
@@ -35,9 +35,9 @@ migraph::argument run_gpu()
p
.
compile
(
migraph
::
gpu
::
target
{});
p
.
compile
(
migraph
::
gpu
::
target
{});
migraph
::
program
::
parameter_map
m
;
migraph
::
program
::
parameter_map
m
;
for
(
auto
&&
x
:
p
.
get_parameter_shapes
())
for
(
auto
&&
x
:
p
.
get_parameter_shapes
())
{
{
m
[
x
.
first
]
=
migraph
::
gpu
::
to_gpu
(
migraph
::
generate_argument
(
x
.
second
));
m
[
x
.
first
]
=
migraph
::
gpu
::
to_gpu
(
migraph
::
generate_argument
(
x
.
second
));
}
}
return
migraph
::
gpu
::
from_gpu
(
p
.
eval
(
m
));
return
migraph
::
gpu
::
from_gpu
(
p
.
eval
(
m
));
...
...
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