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
b8382727
"git@developer.sourcefind.cn:change/sglang.git" did not exist on "817c62a077b2ce95ea67daea93320edd03ef9b36"
Commit
b8382727
authored
Jun 02, 2021
by
Chao Liu
Browse files
bug fix for make_dynamic_naive_tensor_descriptor_aligned_v2
parent
b4d598bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
composable_kernel/include/tensor_description/dynamic_tensor_descriptor_helper.hpp
...e/tensor_description/dynamic_tensor_descriptor_helper.hpp
+9
-5
No files found.
composable_kernel/include/tensor_description/dynamic_tensor_descriptor_helper.hpp
View file @
b8382727
...
@@ -115,26 +115,30 @@ template <typename... Lengths, typename Align>
...
@@ -115,26 +115,30 @@ template <typename... Lengths, typename Align>
__host__
__device__
constexpr
auto
__host__
__device__
constexpr
auto
make_dynamic_naive_tensor_descriptor_aligned_v2
(
const
Tuple
<
Lengths
...
>&
lengths
,
Align
align
)
make_dynamic_naive_tensor_descriptor_aligned_v2
(
const
Tuple
<
Lengths
...
>&
lengths
,
Align
align
)
{
{
constexpr
auto
I1
=
Number
<
1
>
{};
constexpr
index_t
N
=
sizeof
...(
Lengths
);
constexpr
index_t
N
=
sizeof
...(
Lengths
);
const
auto
stride_n_minus_2
=
math
::
integer_least_multiple
(
lengths
[
Number
<
N
-
1
>
{}],
align
);
auto
strides
=
generate_tuple
(
auto
strides
=
generate_tuple
(
[
&
](
auto
i
)
{
[
&
](
auto
i
)
{
if
constexpr
(
i
.
value
==
N
-
1
)
if
constexpr
(
i
.
value
==
N
-
1
)
{
{
return
Number
<
1
>
{}
;
return
I1
;
}
}
else
if
constexpr
(
i
.
value
==
N
-
2
)
else
if
constexpr
(
i
.
value
==
N
-
2
)
{
{
return
math
::
lcm
(
lengths
[
Number
<
N
-
1
>
{}],
align
)
;
return
Number
<
stride_n_minus_2
>
{}
;
}
}
else
else
{
{
return
container_reduce
(
lengths
,
return
container_reduce
(
lengths
,
math
::
multiplies_v2
{},
math
::
multiplies_v2
{},
math
::
lcm
(
lengths
[
Number
<
N
-
1
>
{}],
align
)
,
Number
<
stride_n_minus_2
>
{}
,
i
,
i
+
I1
,
Number
<
N
-
2
>
{},
Number
<
N
-
2
>
{},
Number
<
1
>
{}
);
I1
);
}
}
},
},
Number
<
N
>
{});
Number
<
N
>
{});
...
...
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