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
"test/verify/0ck_elementwise_half_test.cpp" did not exist on "6bf3493aa8e7c9f73051d5e19fb227d73846225c"
Commit
d068a978
authored
Dec 03, 2022
by
Paul
Browse files
Format
parent
c97080ce
Changes
4
Hide 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
...
@@ -39,9 +39,9 @@ MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_GPU_COMPILE_PARALLEL);
...
@@ -39,9 +39,9 @@ MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_GPU_COMPILE_PARALLEL);
struct
precompile_op
struct
precompile_op
{
{
operation
op
=
op
::
identity
{};
operation
op
=
op
::
identity
{};
std
::
size_t
additional_args
=
1
;
std
::
size_t
additional_args
=
1
;
bool
ignore_modules
=
false
;
bool
ignore_modules
=
false
;
optional
<
shape
>
output_shape
=
{};
optional
<
shape
>
output_shape
=
{};
template
<
class
Self
,
class
F
>
template
<
class
Self
,
class
F
>
...
@@ -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
...
@@ -663,15 +663,16 @@ struct find_contiguous_tranpose_precompile
...
@@ -663,15 +663,16 @@ struct find_contiguous_tranpose_precompile
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
{
{
auto
ins
=
r
.
result
;
auto
ins
=
r
.
result
;
auto
op_ins
=
r
.
instructions
[
"op"
];
auto
op_ins
=
r
.
instructions
[
"op"
];
auto
alloc
=
op_ins
->
inputs
().
back
();
auto
alloc
=
op_ins
->
inputs
().
back
();
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
=
auto
v
=
op_ins
->
get_operator
().
to_value
();
shape
::
from_permutation
(
op_ins
->
get_shape
().
type
(),
op_ins
->
get_shape
().
lens
(),
iperm
);
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
);
m
.
replace_instruction
(
op_ins
,
new_op
,
op_ins
->
inputs
(),
op_ins
->
module_inputs
());
m
.
replace_instruction
(
op_ins
,
new_op
,
op_ins
->
inputs
(),
op_ins
->
module_inputs
());
}
}
};
};
...
...
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