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
d068a978
Commit
d068a978
authored
Dec 03, 2022
by
Paul
Browse files
Format
parent
c97080ce
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
11 deletions
+12
-11
src/include/migraphx/serialize.hpp
src/include/migraphx/serialize.hpp
+2
-2
src/include/migraphx/streamutils.hpp
src/include/migraphx/streamutils.hpp
+1
-1
src/targets/gpu/compile_ops.cpp
src/targets/gpu/compile_ops.cpp
+4
-4
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+5
-4
No files found.
src/include/migraphx/serialize.hpp
View file @
d068a978
...
@@ -92,7 +92,7 @@ template <class T>
...
@@ -92,7 +92,7 @@ template <class T>
auto
to_value_impl
(
rank
<
4
>
,
const
optional
<
T
>&
x
)
auto
to_value_impl
(
rank
<
4
>
,
const
optional
<
T
>&
x
)
{
{
value
result
{};
value
result
{};
if
(
x
.
has_value
())
if
(
x
.
has_value
())
to_value
(
*
x
);
to_value
(
*
x
);
return
result
;
return
result
;
}
}
...
@@ -208,7 +208,7 @@ void from_value_impl(rank<5>, const value& v, T& x)
...
@@ -208,7 +208,7 @@ void from_value_impl(rank<5>, const value& v, T& x)
template
<
class
T
>
template
<
class
T
>
void
from_value_impl
(
rank
<
6
>
,
const
value
&
v
,
optional
<
T
>&
x
)
void
from_value_impl
(
rank
<
6
>
,
const
value
&
v
,
optional
<
T
>&
x
)
{
{
if
(
not
v
.
is_null
())
if
(
not
v
.
is_null
())
x
=
from_value
<
T
>
(
v
);
x
=
from_value
<
T
>
(
v
);
}
}
...
...
src/include/migraphx/streamutils.hpp
View file @
d068a978
...
@@ -103,7 +103,7 @@ void stream_write_value_impl(rank<0>, std::ostream& os, const T& x)
...
@@ -103,7 +103,7 @@ void stream_write_value_impl(rank<0>, std::ostream& os, const T& x)
template
<
class
T
>
template
<
class
T
>
void
stream_write_value_impl
(
rank
<
0
>
,
std
::
ostream
&
os
,
const
optional
<
T
>&
x
)
void
stream_write_value_impl
(
rank
<
0
>
,
std
::
ostream
&
os
,
const
optional
<
T
>&
x
)
{
{
if
(
x
.
has_value
())
if
(
x
.
has_value
())
stream_write_value_impl
(
rank
<
2
>
{},
os
,
*
x
);
stream_write_value_impl
(
rank
<
2
>
{},
os
,
*
x
);
else
else
os
<<
"none"
;
os
<<
"none"
;
...
...
src/targets/gpu/compile_ops.cpp
View file @
d068a978
...
@@ -64,7 +64,7 @@ struct precompile_op
...
@@ -64,7 +64,7 @@ struct precompile_op
r
=
op
.
compute_shape
(
inputs
);
r
=
op
.
compute_shape
(
inputs
);
else
else
r
=
op
.
compute_shape
(
inputs
,
mods
);
r
=
op
.
compute_shape
(
inputs
,
mods
);
if
(
output_shape
.
has_value
())
if
(
output_shape
.
has_value
())
r
=
*
output_shape
;
r
=
*
output_shape
;
return
r
;
return
r
;
}
}
...
...
src/targets/gpu/fuse_ops.cpp
View file @
d068a978
...
@@ -668,7 +668,8 @@ struct find_contiguous_tranpose_precompile
...
@@ -668,7 +668,8 @@ struct find_contiguous_tranpose_precompile
auto
transpose
=
r
.
instructions
[
"transpose"
];
auto
transpose
=
r
.
instructions
[
"transpose"
];
auto
perm
=
transpose
->
get_operator
().
to_value
()[
"permutation"
].
to_vector
<
int64_t
>
();
auto
perm
=
transpose
->
get_operator
().
to_value
()[
"permutation"
].
to_vector
<
int64_t
>
();
auto
iperm
=
invert_permutation
(
perm
);
auto
iperm
=
invert_permutation
(
perm
);
auto
s
=
shape
::
from_permutation
(
op_ins
->
get_shape
().
type
(),
op_ins
->
get_shape
().
lens
(),
iperm
);
auto
s
=
shape
::
from_permutation
(
op_ins
->
get_shape
().
type
(),
op_ins
->
get_shape
().
lens
(),
iperm
);
auto
v
=
op_ins
->
get_operator
().
to_value
();
auto
v
=
op_ins
->
get_operator
().
to_value
();
v
[
"output_shape"
]
=
to_value
(
s
);
v
[
"output_shape"
]
=
to_value
(
s
);
auto
new_op
=
make_op
(
"gpu::precompile_op"
,
v
);
auto
new_op
=
make_op
(
"gpu::precompile_op"
,
v
);
...
...
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