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
c1ee4cf4
Commit
c1ee4cf4
authored
Nov 15, 2023
by
Paul
Browse files
Format
parent
fb706c81
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
22 deletions
+18
-22
src/cpp_generator.cpp
src/cpp_generator.cpp
+3
-2
src/include/migraphx/op/identity.hpp
src/include/migraphx/op/identity.hpp
+1
-4
src/targets/gpu/jit/concat.cpp
src/targets/gpu/jit/concat.cpp
+14
-16
No files found.
src/cpp_generator.cpp
View file @
c1ee4cf4
...
...
@@ -200,8 +200,9 @@ cpp_generator::function cpp_generator::generate_module(const module& m,
const
generate_module_callback
&
g
)
{
function
f
;
f
.
set_name
(
to_c_id
(
m
.
name
())).
set_types
(
m
).
set_body
(
m
,
[
&
](
instruction_ref
ins
,
const
auto
&
names
)
->
std
::
string
{
f
.
set_name
(
to_c_id
(
m
.
name
()))
.
set_types
(
m
)
.
set_body
(
m
,
[
&
](
instruction_ref
ins
,
const
auto
&
names
)
->
std
::
string
{
if
(
ins
->
name
()
==
"@literal"
)
{
std
::
string
string_literal
;
...
...
src/include/migraphx/op/identity.hpp
View file @
c1ee4cf4
...
...
@@ -37,10 +37,7 @@ struct identity
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
return
inputs
.
at
(
0
);
}
argument
compute
(
shape
,
std
::
vector
<
argument
>
args
)
const
{
return
args
[
0
];
}
value
attributes
()
const
{
return
{{
"pointwise"
,
true
},
{
"point_op"
,
"${0}"
}};
}
value
attributes
()
const
{
return
{{
"pointwise"
,
true
},
{
"point_op"
,
"${0}"
}};
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/targets/gpu/jit/concat.cpp
View file @
c1ee4cf4
...
...
@@ -215,15 +215,14 @@ struct fused_concat_compiler : compiler<fused_concat_compiler>
v
[
"post"
]
=
"MIGRAPHX_LIFT("
+
mod_names_lookup
.
at
(
last_mod
->
name
())
+
")"
;
std
::
unordered_map
<
std
::
string
,
std
::
size_t
>
mod_args
;
std
::
transform
(
ins
->
module_inputs
().
begin
(),
ins
->
module_inputs
().
end
()
-
1
,
ins
->
module_inputs
().
end
()
-
1
,
std
::
inserter
(
mod_args
,
mod_args
.
end
()),
[
&
](
module_ref
mod
)
{
const
auto
&
name
=
mod_names_lookup
.
at
(
mod
->
name
());
return
std
::
make_pair
(
name
,
mod
->
get_parameter_names
().
size
());
});
v
[
"args"
]
=
mod_args
;
auto
prefix_name
=
transform_accumulate
(
ins
->
module_inputs
().
begin
(),
auto
prefix_name
=
transform_accumulate
(
ins
->
module_inputs
().
begin
(),
ins
->
module_inputs
().
end
()
-
1
,
std
::
string
{},
std
::
plus
<>
{},
...
...
@@ -233,9 +232,8 @@ struct fused_concat_compiler : compiler<fused_concat_compiler>
return
""
;
return
name
+
"_"
;
});
v
[
"kernel"
]
=
prefix_name
+
"concat_"
+
generate_name_from_ops
(
*
(
ins
->
module_inputs
().
back
()))
+
"_kernel"
;
v
[
"kernel"
]
=
prefix_name
+
"concat_"
+
generate_name_from_ops
(
*
(
ins
->
module_inputs
().
back
()))
+
"_kernel"
;
return
compile_op
(
ctx
,
to_shapes
(
ins
->
inputs
()),
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