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
33298b0b
Commit
33298b0b
authored
Jun 22, 2018
by
Paul
Browse files
Formatting
parent
5aa4e686
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
test/miopen/miopen.cpp
test/miopen/miopen.cpp
+7
-9
No files found.
test/miopen/miopen.cpp
View file @
33298b0b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#include "test.hpp"
#include "test.hpp"
#include "verify.hpp"
#include "verify.hpp"
template
<
class
V
>
template
<
class
V
>
rtg
::
argument
run_cpu
()
rtg
::
argument
run_cpu
()
{
{
V
v
;
V
v
;
...
@@ -22,7 +22,7 @@ rtg::argument run_cpu()
...
@@ -22,7 +22,7 @@ rtg::argument run_cpu()
return
p
.
eval
(
v
.
create_params
());
return
p
.
eval
(
v
.
create_params
());
}
}
template
<
class
V
>
template
<
class
V
>
rtg
::
argument
run_gpu
()
rtg
::
argument
run_gpu
()
{
{
V
v
;
V
v
;
...
@@ -30,29 +30,27 @@ rtg::argument run_gpu()
...
@@ -30,29 +30,27 @@ rtg::argument run_gpu()
p
.
compile
(
rtg
::
miopen
::
miopen_target
{});
p
.
compile
(
rtg
::
miopen
::
miopen_target
{});
auto
m
=
v
.
create_params
();
auto
m
=
v
.
create_params
();
for
(
auto
&&
e
:
m
)
for
(
auto
&&
e
:
m
)
{
{
e
.
second
=
rtg
::
miopen
::
to_gpu
(
e
.
second
);
e
.
second
=
rtg
::
miopen
::
to_gpu
(
e
.
second
);
}
}
m
[
"output"
]
=
rtg
::
miopen
::
to_gpu
(
rtg
::
generate_argument
(
p
.
get_parameter_shape
(
"output"
)));
m
[
"output"
]
=
rtg
::
miopen
::
to_gpu
(
rtg
::
generate_argument
(
p
.
get_parameter_shape
(
"output"
)));
auto
handle
=
rtg
::
miopen
::
make_obj
<
rtg
::
miopen
::
miopen_handle
>
(
&
miopenCreate
);
auto
handle
=
rtg
::
miopen
::
make_obj
<
rtg
::
miopen
::
miopen_handle
>
(
&
miopenCreate
);
m
[
"handle"
]
=
{
rtg
::
shape
::
any_type
,
handle
.
get
()};
m
[
"handle"
]
=
{
rtg
::
shape
::
any_type
,
handle
.
get
()};
return
rtg
::
miopen
::
from_gpu
(
p
.
eval
(
m
));
return
rtg
::
miopen
::
from_gpu
(
p
.
eval
(
m
));
}
}
template
<
class
V
>
template
<
class
V
>
void
verify_program
()
void
verify_program
()
{
{
auto
cpu_arg
=
run_cpu
<
V
>
();
auto
cpu_arg
=
run_cpu
<
V
>
();
auto
gpu_arg
=
run_gpu
<
V
>
();
auto
gpu_arg
=
run_gpu
<
V
>
();
visit_all
(
cpu_arg
,
gpu_arg
)([](
auto
cpu
,
auto
gpu
)
{
visit_all
(
cpu_arg
,
gpu_arg
)([](
auto
cpu
,
auto
gpu
)
{
EXPECT
(
test
::
verify_range
(
cpu
,
gpu
));
});
EXPECT
(
test
::
verify_range
(
cpu
,
gpu
));
});
}
}
struct
test1
struct
test1
{
{
rtg
::
program
create_program
()
const
rtg
::
program
create_program
()
const
{
{
...
...
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