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
fe61d940
Unverified
Commit
fe61d940
authored
Dec 07, 2023
by
Umang Yadav
Committed by
GitHub
Dec 07, 2023
Browse files
print ref results (#2530)
parent
22f60c24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
test/verify/run_verify.cpp
test/verify/run_verify.cpp
+11
-9
test/verify/run_verify.hpp
test/verify/run_verify.hpp
+5
-3
No files found.
test/verify/run_verify.cpp
View file @
fe61d940
...
@@ -136,16 +136,18 @@ void run_verify::validate(const migraphx::target& t,
...
@@ -136,16 +136,18 @@ void run_verify::validate(const migraphx::target& t,
ti
.
validate
(
p
,
m
);
ti
.
validate
(
p
,
m
);
}
}
std
::
vector
<
migraphx
::
argument
>
run_verify
::
run_ref
(
migraphx
::
program
p
,
std
::
pair
<
migraphx
::
program
,
std
::
vector
<
migraphx
::
argument
>>
migraphx
::
parameter_map
inputs
,
run_verify
::
run_ref
(
migraphx
::
program
p
,
const
migraphx
::
compile_options
&
c_opts
)
const
migraphx
::
parameter_map
inputs
,
const
migraphx
::
compile_options
&
c_opts
)
const
{
{
migraphx
::
target
t
=
migraphx
::
make_target
(
"ref"
);
migraphx
::
target
t
=
migraphx
::
make_target
(
"ref"
);
auto_print
pp
{
p
,
t
.
name
()};
auto_print
pp
{
p
,
t
.
name
()};
auto
trace_target
=
migraphx
::
string_value_of
(
MIGRAPHX_TRACE_TEST_COMPILE
{});
auto
trace_target
=
migraphx
::
string_value_of
(
MIGRAPHX_TRACE_TEST_COMPILE
{});
compile_check
(
p
,
t
,
c_opts
,
(
trace_target
==
"ref"
));
compile_check
(
p
,
t
,
c_opts
,
(
trace_target
==
"ref"
));
return
p
.
eval
(
std
::
move
(
inputs
));
return
std
::
make_pair
(
std
::
move
(
p
),
p
.
eval
(
std
::
move
(
inputs
))
)
;
}
}
std
::
pair
<
migraphx
::
program
,
std
::
vector
<
migraphx
::
argument
>>
std
::
pair
<
migraphx
::
program
,
std
::
vector
<
migraphx
::
argument
>>
run_verify
::
run_target
(
const
migraphx
::
target
&
t
,
run_verify
::
run_target
(
const
migraphx
::
target
&
t
,
migraphx
::
program
p
,
migraphx
::
program
p
,
...
@@ -226,7 +228,7 @@ void run_verify::verify(const std::string& name,
...
@@ -226,7 +228,7 @@ void run_verify::verify(const std::string& name,
}
}
}
}
auto
gold
_f
=
detach_async
([
=
]
{
return
run_ref
(
p
,
m
,
c_opts
);
});
auto
ref
_f
=
detach_async
([
=
]
{
return
run_ref
(
p
,
m
,
c_opts
);
});
for
(
const
auto
&
tname
:
target_names
)
for
(
const
auto
&
tname
:
target_names
)
{
{
target_info
ti
=
get_target_info
(
tname
);
target_info
ti
=
get_target_info
(
tname
);
...
@@ -235,8 +237,8 @@ void run_verify::verify(const std::string& name,
...
@@ -235,8 +237,8 @@ void run_verify::verify(const std::string& name,
tname
,
detach_async
([
=
]
{
return
run_target
(
t
,
p
,
m
,
c_opts
);
},
ti
.
parallel
));
tname
,
detach_async
([
=
]
{
return
run_target
(
t
,
p
,
m
,
c_opts
);
},
ti
.
parallel
));
}
}
assert
(
gold
_f
.
valid
());
assert
(
ref
_f
.
valid
());
auto
gold
=
gold
_f
.
get
();
auto
ref_results
=
ref
_f
.
get
();
for
(
auto
&&
pp
:
results
)
for
(
auto
&&
pp
:
results
)
{
{
...
@@ -245,7 +247,7 @@ void run_verify::verify(const std::string& name,
...
@@ -245,7 +247,7 @@ void run_verify::verify(const std::string& name,
auto
x
=
pp
.
second
.
get
();
auto
x
=
pp
.
second
.
get
();
auto
cp
=
x
.
first
;
auto
cp
=
x
.
first
;
auto
result
=
x
.
second
;
auto
result
=
x
.
second
;
auto
gold
=
ref_results
.
second
;
bool
passed
=
true
;
bool
passed
=
true
;
passed
&=
(
gold
.
size
()
==
result
.
size
());
passed
&=
(
gold
.
size
()
==
result
.
size
());
std
::
size_t
num
=
gold
.
size
();
std
::
size_t
num
=
gold
.
size
();
...
@@ -258,7 +260,7 @@ void run_verify::verify(const std::string& name,
...
@@ -258,7 +260,7 @@ void run_verify::verify(const std::string& name,
if
(
not
passed
or
migraphx
::
enabled
(
MIGRAPHX_TRACE_TEST
{}))
if
(
not
passed
or
migraphx
::
enabled
(
MIGRAPHX_TRACE_TEST
{}))
{
{
std
::
cout
<<
p
<<
std
::
endl
;
std
::
cout
<<
p
<<
std
::
endl
;
std
::
cout
<<
"ref:
\n
"
<<
p
<<
std
::
endl
;
std
::
cout
<<
"ref:
\n
"
<<
ref_results
.
first
<<
std
::
endl
;
std
::
cout
<<
tname
<<
":
\n
"
<<
cp
<<
std
::
endl
;
std
::
cout
<<
tname
<<
":
\n
"
<<
cp
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
}
}
...
...
test/verify/run_verify.hpp
View file @
fe61d940
...
@@ -39,9 +39,11 @@ struct target_info
...
@@ -39,9 +39,11 @@ struct target_info
struct
run_verify
struct
run_verify
{
{
std
::
vector
<
migraphx
::
argument
>
run_ref
(
migraphx
::
program
p
,
std
::
pair
<
migraphx
::
program
,
std
::
vector
<
migraphx
::
argument
>>
migraphx
::
parameter_map
inputs
,
run_ref
(
migraphx
::
program
p
,
const
migraphx
::
compile_options
&
c_opts
)
const
;
migraphx
::
parameter_map
inputs
,
const
migraphx
::
compile_options
&
c_opts
)
const
;
std
::
pair
<
migraphx
::
program
,
std
::
vector
<
migraphx
::
argument
>>
std
::
pair
<
migraphx
::
program
,
std
::
vector
<
migraphx
::
argument
>>
run_target
(
const
migraphx
::
target
&
t
,
run_target
(
const
migraphx
::
target
&
t
,
migraphx
::
program
p
,
migraphx
::
program
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