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
a86f411b
Commit
a86f411b
authored
Jul 02, 2022
by
Paul
Browse files
Fix query string
parent
9b3b10ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
src/targets/gpu/perfdb.cpp
src/targets/gpu/perfdb.cpp
+12
-6
No files found.
src/targets/gpu/perfdb.cpp
View file @
a86f411b
...
@@ -51,9 +51,9 @@ std::string generate_miopen_config(const problem_params& pp)
...
@@ -51,9 +51,9 @@ std::string generate_miopen_config(const problem_params& pp)
to_string
(
weights
[
0
]),
to_string
(
weights
[
0
]),
to_string_range
(
output
.
begin
()
+
2
,
output
.
end
(),
"x"
),
to_string_range
(
output
.
begin
()
+
2
,
output
.
end
(),
"x"
),
to_string
(
input
[
0
]),
to_string
(
input
[
0
]),
to_string_range
(
padding
.
begin
()
+
2
,
padding
.
end
(),
"x"
),
to_string_range
(
padding
.
begin
(),
padding
.
end
(),
"x"
),
to_string_range
(
stride
.
begin
()
+
2
,
stride
.
end
(),
"x"
),
to_string_range
(
stride
.
begin
(),
stride
.
end
(),
"x"
),
to_string_range
(
dilation
.
begin
()
+
2
,
dilation
.
end
(),
"x"
),
to_string_range
(
dilation
.
begin
(),
dilation
.
end
(),
"x"
),
std
::
string
{
"0"
},
std
::
string
{
"0"
},
get_layout
(
pp
.
inputs
[
0
],
"NCHW"
),
get_layout
(
pp
.
inputs
[
0
],
"NCHW"
),
get_layout
(
pp
.
inputs
[
1
],
"NCHW"
),
get_layout
(
pp
.
inputs
[
1
],
"NCHW"
),
...
@@ -63,14 +63,20 @@ std::string generate_miopen_config(const problem_params& pp)
...
@@ -63,14 +63,20 @@ std::string generate_miopen_config(const problem_params& pp)
"-"
);
"-"
);
}
}
auto
query_miopen_db
(
const
std
::
string
&
query
)
{
// TODO: Store db as a static variable
const
auto
dbpath
=
fs
::
path
{
"opt"
}
/
"rocm"
/
"share"
/
"miopen"
/
"db"
/
"miopen.db"
;
auto
db
=
sqlite
::
read
(
dbpath
);
return
db
.
execute
(
query
);
}
}
// namespace
}
// namespace
std
::
string
get_mlir_perf_for_conv
(
const
problem_params
&
pp
)
std
::
string
get_mlir_perf_for_conv
(
const
problem_params
&
pp
)
{
{
const
auto
dbpath
=
fs
::
path
{
"opt"
}
/
"rocm"
/
"share"
/
"miopen"
/
"db"
/
"miopen.db"
;
auto
db
=
sqlite
::
read
(
dbpath
);
std
::
string
query
=
"select * from perf_db where config=${config}"
;
std
::
string
query
=
"select * from perf_db where config=${config}"
;
auto
results
=
db
.
execute
(
interpolate_string
(
query
,
{{
"config"
,
generate_miopen_config
(
pp
)}}));
auto
results
=
query_miopen_db
(
interpolate_string
(
query
,
{{
"config"
,
generate_miopen_config
(
pp
)}}));
if
(
results
.
empty
())
if
(
results
.
empty
())
return
""
;
return
""
;
return
results
.
front
().
at
(
"params"
);
return
results
.
front
().
at
(
"params"
);
...
...
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