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
13238ba1
Commit
13238ba1
authored
Sep 06, 2022
by
Paul
Browse files
Format
parent
eb186040
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
src/targets/gpu/compile_ops.cpp
src/targets/gpu/compile_ops.cpp
+5
-6
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+4
-4
No files found.
src/targets/gpu/compile_ops.cpp
View file @
13238ba1
...
@@ -41,15 +41,14 @@ struct precompile_op
...
@@ -41,15 +41,14 @@ 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
;
template
<
class
Self
,
class
F
>
template
<
class
Self
,
class
F
>
static
auto
reflect
(
Self
&
self
,
F
f
)
static
auto
reflect
(
Self
&
self
,
F
f
)
{
{
return
pack
(
f
(
self
.
op
,
"op"
),
return
pack
(
f
(
self
.
op
,
"op"
),
f
(
self
.
additional_args
,
"additional_args"
),
f
(
self
.
additional_args
,
"additional_args"
),
f
(
self
.
ignore_modules
,
"ignore_modules"
)
f
(
self
.
ignore_modules
,
"ignore_modules"
));
);
}
}
std
::
string
name
()
const
{
return
"gpu::precompile_op"
;
}
std
::
string
name
()
const
{
return
"gpu::precompile_op"
;
}
...
@@ -58,7 +57,7 @@ struct precompile_op
...
@@ -58,7 +57,7 @@ struct precompile_op
{
{
// Pop off additional args
// Pop off additional args
inputs
.
resize
(
inputs
.
size
()
-
additional_args
);
inputs
.
resize
(
inputs
.
size
()
-
additional_args
);
if
(
ignore_modules
)
if
(
ignore_modules
)
return
op
.
compute_shape
(
inputs
);
return
op
.
compute_shape
(
inputs
);
return
op
.
compute_shape
(
inputs
,
mods
);
return
op
.
compute_shape
(
inputs
,
mods
);
}
}
...
...
src/targets/gpu/fuse_ops.cpp
View file @
13238ba1
...
@@ -1190,15 +1190,15 @@ struct find_concat_pointwise
...
@@ -1190,15 +1190,15 @@ struct find_concat_pointwise
{
{
auto
matcher
()
const
auto
matcher
()
const
{
{
return
precompile_name
(
"pointwise"
)(
match
::
arg
(
0
)(
return
precompile_name
(
"pointwise"
)(
precompile_name
(
"concat"
).
bind
(
"concat"
)));
match
::
arg
(
0
)(
precompile_name
(
"concat"
).
bind
(
"concat"
)));
}
}
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
concat
=
r
.
instructions
[
"concat"
];
auto
concat
=
r
.
instructions
[
"concat"
];
auto
*
pm
=
ins
->
module_inputs
().
front
();
auto
*
pm
=
ins
->
module_inputs
().
front
();
if
(
not
concat
->
module_inputs
().
empty
())
if
(
not
concat
->
module_inputs
().
empty
())
return
;
return
;
...
...
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