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
composable_kernel
Commits
4defb148
Commit
4defb148
authored
Sep 12, 2022
by
Po-Yen, Chen
Browse files
Usw switch() to group similar codes
parent
3cbf5d96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
example/37_permute/common.hpp
example/37_permute/common.hpp
+6
-6
No files found.
example/37_permute/common.hpp
View file @
4defb148
...
...
@@ -493,8 +493,9 @@ host_permute(const Tensor<Src>& src, const Axes& axes, Functor functor, Tensor<D
return
false
;
}
if
(
size
(
shape
)
==
3
)
switch
(
size
(
shape
))
{
case
3
:
{
do
{
Dest
output
=
0
;
...
...
@@ -502,8 +503,8 @@ host_permute(const Tensor<Src>& src, const Axes& axes, Functor functor, Tensor<D
dest
(
indices
[
axes
[
0
]],
indices
[
axes
[
1
]],
indices
[
axes
[
2
]])
=
output
;
}
while
(
advance_indices
(
shape
,
indices
));
}
else
if
(
size
(
shape
)
==
4
)
{
break
;
case
4
:
{
do
{
Dest
output
=
0
;
...
...
@@ -511,9 +512,8 @@ host_permute(const Tensor<Src>& src, const Axes& axes, Functor functor, Tensor<D
dest
(
indices
[
axes
[
0
]],
indices
[
axes
[
1
]],
indices
[
axes
[
2
]],
indices
[
axes
[
3
]])
=
output
;
}
while
(
advance_indices
(
shape
,
indices
));
}
else
{
return
false
;
break
;
default:
return
false
;
}
return
true
;
...
...
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