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
00bfed4d
Unverified
Commit
00bfed4d
authored
Dec 08, 2021
by
Paul Fultz II
Committed by
GitHub
Dec 08, 2021
Browse files
Fuse convert ops (#1020)
parent
1793cc54
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
src/fuse_pointwise.cpp
src/fuse_pointwise.cpp
+0
-3
src/include/migraphx/op/convert.hpp
src/include/migraphx/op/convert.hpp
+5
-0
src/targets/gpu/kernels/include/migraphx/kernels/math.hpp
src/targets/gpu/kernels/include/migraphx/kernels/math.hpp
+6
-0
No files found.
src/fuse_pointwise.cpp
View file @
00bfed4d
...
...
@@ -33,9 +33,6 @@ static void create_pointwise_modules(module_pass_manager& mpm)
{
if
(
not
ins
->
get_operator
().
attributes
().
get
(
"pointwise"
,
false
))
continue
;
// Skip convert op for now
if
(
ins
->
name
()
==
"convert"
)
continue
;
assert
(
ins
->
get_operator
().
attributes
().
contains
(
"point_op"
));
auto
*
pm
=
mpm
.
create_module
(
mpm
.
get_module
().
name
()
+
":pointwise"
+
std
::
to_string
(
n
++
));
pm
->
set_bypass
();
...
...
src/include/migraphx/op/convert.hpp
View file @
00bfed4d
...
...
@@ -32,6 +32,11 @@ struct convert : unary<convert>
return
{
target_type
,
inputs
.
at
(
0
).
lens
(),
inputs
.
at
(
0
).
strides
()};
}
std
::
string
point_op
()
const
{
return
"${function:convert}<"
+
shape
::
cpp_type
(
target_type
)
+
">(${0})"
;
}
auto
apply
()
const
{
auto
type
=
target_type
;
...
...
src/targets/gpu/kernels/include/migraphx/kernels/math.hpp
View file @
00bfed4d
...
...
@@ -110,5 +110,11 @@ constexpr auto& min(const T& a, const U& b)
return
(
a
>
b
)
?
b
:
a
;
}
template
<
class
T
,
class
U
>
constexpr
T
convert
(
U
x
)
{
return
x
;
}
}
// namespace migraphx
#endif // MIGRAPHX_GUARD_KERNELS_MATH_HPP
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