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
8a2837c4
Commit
8a2837c4
authored
Jun 02, 2023
by
Alan Turner
Browse files
Add where op workaround for CK
parent
a47adf4b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
src/onnx/parse_where.cpp
src/onnx/parse_where.cpp
+9
-0
No files found.
src/onnx/parse_where.cpp
View file @
8a2837c4
...
@@ -31,6 +31,8 @@ namespace migraphx {
...
@@ -31,6 +31,8 @@ namespace migraphx {
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
onnx
{
namespace
onnx
{
MIGRAPHX_DECLARE_ENV_VAR
(
MIGRAPHX_ENABLE_CK
)
struct
parse_where
:
op_parser
<
parse_where
>
struct
parse_where
:
op_parser
<
parse_where
>
{
{
std
::
vector
<
op_desc
>
operators
()
const
{
return
{{
"Where"
}};
}
std
::
vector
<
op_desc
>
operators
()
const
{
return
{{
"Where"
}};
}
...
@@ -56,6 +58,13 @@ struct parse_where : op_parser<parse_where>
...
@@ -56,6 +58,13 @@ struct parse_where : op_parser<parse_where>
auto
lens
=
auto
lens
=
compute_broadcasted_lens
(
args
[
0
]
->
get_shape
().
lens
(),
args
[
1
]
->
get_shape
().
lens
());
compute_broadcasted_lens
(
args
[
0
]
->
get_shape
().
lens
(),
args
[
1
]
->
get_shape
().
lens
());
lens
=
compute_broadcasted_lens
(
lens
,
args
[
2
]
->
get_shape
().
lens
());
lens
=
compute_broadcasted_lens
(
lens
,
args
[
2
]
->
get_shape
().
lens
());
if
(
enabled
(
MIGRAPHX_ENABLE_CK
{}))
{
// Convert condition tensor to int32 to work around CK not supporting bool type
args
[
0
]
=
info
.
add_instruction
(
make_op
(
"convert"
,
{{
"target_type"
,
shape
::
int32_type
}}),
args
[
0
]);
}
if
(
args
[
0
]
->
get_shape
().
lens
()
!=
lens
)
if
(
args
[
0
]
->
get_shape
().
lens
()
!=
lens
)
{
{
args
[
0
]
=
args
[
0
]
=
...
...
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