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
31a264fb
Commit
31a264fb
authored
Sep 20, 2023
by
Umang Yadav
Browse files
Rename verify_args
parent
8930d23d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
18 deletions
+18
-18
src/driver/verify.cpp
src/driver/verify.cpp
+1
-1
src/include/migraphx/verify_args.hpp
src/include/migraphx/verify_args.hpp
+6
-6
src/verify_args.cpp
src/verify_args.cpp
+9
-9
test/gpu/mlir.cpp
test/gpu/mlir.cpp
+1
-1
test/verify/run_verify.cpp
test/verify/run_verify.cpp
+1
-1
No files found.
src/driver/verify.cpp
View file @
31a264fb
...
@@ -84,7 +84,7 @@ void verify_program(const std::string& name,
...
@@ -84,7 +84,7 @@ void verify_program(const std::string& name,
std
::
size_t
output_num
=
ref_outs
.
size
();
std
::
size_t
output_num
=
ref_outs
.
size
();
for
(
std
::
size_t
i
=
0
;
i
<
output_num
;
++
i
)
for
(
std
::
size_t
i
=
0
;
i
<
output_num
;
++
i
)
{
{
verify_args
_with_threshold
(
name
,
target_outs
[
i
],
verify
::
expected
{
ref_outs
[
i
]},
tols
);
verify_args
(
name
,
target_outs
[
i
],
verify
::
expected
{
ref_outs
[
i
]},
tols
);
}
}
}
}
...
...
src/include/migraphx/verify_args.hpp
View file @
31a264fb
...
@@ -31,15 +31,15 @@
...
@@ -31,15 +31,15 @@
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
MIGRAPHX_EXPORT
bool
verify_args_with_threshold
(
const
std
::
string
&
name
,
const
argument
&
target_arg
,
const
verify
::
expected
<
argument
>&
ref_arg
,
verify
::
tolerance
);
MIGRAPHX_EXPORT
bool
verify_args
(
const
std
::
string
&
name
,
MIGRAPHX_EXPORT
bool
verify_args
(
const
std
::
string
&
name
,
const
argument
&
target_arg
,
const
argument
&
target_arg
,
const
verify
::
expected
<
argument
>&
ref_arg
,
const
verify
::
expected
<
argument
>&
ref_arg
,
std
::
size_t
tolerance
=
80
);
verify
::
tolerance
);
MIGRAPHX_EXPORT
bool
verify_args_with_tolerance
(
const
std
::
string
&
name
,
const
argument
&
target_arg
,
const
verify
::
expected
<
argument
>&
ref_arg
,
std
::
size_t
tolerance
=
80
);
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
...
...
src/verify_args.cpp
View file @
31a264fb
...
@@ -27,10 +27,10 @@
...
@@ -27,10 +27,10 @@
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
bool
verify_args
_with_threshold
(
const
std
::
string
&
name
,
bool
verify_args
(
const
std
::
string
&
name
,
const
argument
&
target_arg
,
const
argument
&
target_arg
,
const
verify
::
expected
<
argument
>&
ref_arg
,
const
verify
::
expected
<
argument
>&
ref_arg
,
verify
::
tolerance
tols
)
verify
::
tolerance
tols
)
{
{
bool
passed
=
true
;
bool
passed
=
true
;
visit_all
(
ref_arg
.
data
(),
target_arg
)([
&
](
auto
ref
,
auto
target
)
{
visit_all
(
ref_arg
.
data
(),
target_arg
)([
&
](
auto
ref
,
auto
target
)
{
...
@@ -94,15 +94,15 @@ bool verify_args_with_threshold(const std::string& name,
...
@@ -94,15 +94,15 @@ bool verify_args_with_threshold(const std::string& name,
return
passed
;
return
passed
;
}
}
bool
verify_args
(
const
std
::
string
&
name
,
bool
verify_args
_with_tolerance
(
const
std
::
string
&
name
,
const
argument
&
target_arg
,
const
argument
&
target_arg
,
const
verify
::
expected
<
argument
>&
ref_arg
,
const
verify
::
expected
<
argument
>&
ref_arg
,
std
::
size_t
tolerance
)
std
::
size_t
tolerance
)
{
{
double
rms_tol
=
0.001
;
double
rms_tol
=
0.001
;
target_arg
.
visit
([
&
](
auto
ta
)
{
rms_tol
=
verify
::
get_rms_tol
(
ta
,
tolerance
);
});
target_arg
.
visit
([
&
](
auto
ta
)
{
rms_tol
=
verify
::
get_rms_tol
(
ta
,
tolerance
);
});
verify
::
tolerance
tols
{
rms_tol
};
verify
::
tolerance
tols
{
rms_tol
};
return
verify_args
_with_threshold
(
name
,
target_arg
,
ref_arg
,
tols
);
return
verify_args
(
name
,
target_arg
,
ref_arg
,
tols
);
}
}
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
...
...
test/gpu/mlir.cpp
View file @
31a264fb
...
@@ -133,7 +133,7 @@ bool verify_mlir(const migraphx::module& mmlir)
...
@@ -133,7 +133,7 @@ bool verify_mlir(const migraphx::module& mmlir)
auto
inputs
=
generate_params
(
ref
);
auto
inputs
=
generate_params
(
ref
);
auto
mlir
=
create_program_from_mlir
(
mmlir
);
auto
mlir
=
create_program_from_mlir
(
mmlir
);
return
migraphx
::
verify_args
(
return
migraphx
::
verify_args
_with_tolerance
(
"mlir"
,
run_gpu
(
mlir
,
inputs
),
migraphx
::
verify
::
expected
{
run_ref
(
ref
,
inputs
)});
"mlir"
,
run_gpu
(
mlir
,
inputs
),
migraphx
::
verify
::
expected
{
run_ref
(
ref
,
inputs
)});
}
}
...
...
test/verify/run_verify.cpp
View file @
31a264fb
...
@@ -252,7 +252,7 @@ void run_verify::verify(const std::string& name,
...
@@ -252,7 +252,7 @@ void run_verify::verify(const std::string& name,
for
(
std
::
size_t
i
=
0
;
((
i
<
num
)
and
passed
);
++
i
)
for
(
std
::
size_t
i
=
0
;
((
i
<
num
)
and
passed
);
++
i
)
{
{
passed
&=
passed
&=
migraphx
::
verify_args
(
tname
,
result
[
i
],
migraphx
::
verify
::
expected
{
gold
[
i
]});
migraphx
::
verify_args
_with_tolerance
(
tname
,
result
[
i
],
migraphx
::
verify
::
expected
{
gold
[
i
]});
}
}
if
(
not
passed
or
migraphx
::
enabled
(
MIGRAPHX_TRACE_TEST
{}))
if
(
not
passed
or
migraphx
::
enabled
(
MIGRAPHX_TRACE_TEST
{}))
...
...
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