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
e91c8fc2
Commit
e91c8fc2
authored
May 30, 2023
by
Paul
Browse files
Use transform
parent
4cfc964e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
src/targets/gpu/compile_ops.cpp
src/targets/gpu/compile_ops.cpp
+6
-8
No files found.
src/targets/gpu/compile_ops.cpp
View file @
e91c8fc2
...
@@ -119,7 +119,7 @@ struct compile_plan
...
@@ -119,7 +119,7 @@ struct compile_plan
{
{
if
(
config
.
has_value
())
if
(
config
.
has_value
())
{
{
const
auto
&
problem
=
config
.
value
().
problem
;
const
auto
&
problem
=
config
->
problem
;
if
(
auto
sol
=
pc
.
get
(
preop
.
name
(),
problem
))
if
(
auto
sol
=
pc
.
get
(
preop
.
name
(),
problem
))
{
{
auto
solution
=
sol
.
value
();
auto
solution
=
sol
.
value
();
...
@@ -134,7 +134,7 @@ struct compile_plan
...
@@ -134,7 +134,7 @@ struct compile_plan
else
else
{
{
pc
.
mark
(
preop
.
name
(),
problem
);
pc
.
mark
(
preop
.
name
(),
problem
);
const
auto
&
solutions
=
config
.
value
().
solutions
;
const
auto
&
solutions
=
config
->
solutions
;
results
.
resize
(
solutions
.
size
());
results
.
resize
(
solutions
.
size
());
for
(
auto
i
:
range
(
solutions
.
size
()))
for
(
auto
i
:
range
(
solutions
.
size
()))
{
{
...
@@ -163,13 +163,11 @@ struct compile_plan
...
@@ -163,13 +163,11 @@ struct compile_plan
<<
std
::
endl
;
<<
std
::
endl
;
std
::
vector
<
double
>
times
;
std
::
vector
<
double
>
times
;
times
.
reserve
(
results
.
size
());
times
.
reserve
(
results
.
size
());
for
(
const
auto
&
cr
:
results
)
std
::
transform
(
results
.
begin
(),
results
.
end
(),
std
::
back_inserter
(
times
),
[
&
](
const
auto
&
cr
)
{
{
return
time_op
(
*
ctx
,
cr
.
replace
.
code_object
,
to_shapes
(
cr
.
ins
->
inputs
()),
20
).
first
;
times
.
push_back
(
});
time_op
(
*
ctx
,
cr
.
replace
.
code_object
,
to_shapes
(
cr
.
ins
->
inputs
()),
20
).
first
);
}
auto
i
=
std
::
distance
(
times
.
begin
(),
std
::
min_element
(
times
.
begin
(),
times
.
end
()));
auto
i
=
std
::
distance
(
times
.
begin
(),
std
::
min_element
(
times
.
begin
(),
times
.
end
()));
pc
.
insert
(
preop
.
name
(),
config
.
value
().
problem
,
config
.
value
().
solutions
.
at
(
i
));
pc
.
insert
(
preop
.
name
(),
config
->
problem
,
config
->
solutions
.
at
(
i
));
return
results
[
i
];
return
results
[
i
];
}
}
void
replace
(
module
&
m
,
problem_cache
&
pc
)
const
void
replace
(
module
&
m
,
problem_cache
&
pc
)
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