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
2717e60d
Commit
2717e60d
authored
Jul 27, 2022
by
ltqin
Browse files
code regular
parent
d8154515
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
include/ck/tensor_operation/gpu/block/blockwise_softmax_v1.hpp
...de/ck/tensor_operation/gpu/block/blockwise_softmax_v1.hpp
+4
-6
No files found.
include/ck/tensor_operation/gpu/block/blockwise_softmax_v1.hpp
View file @
2717e60d
...
...
@@ -91,12 +91,10 @@ struct BlockwiseSoftmax_V1
detail
::
AccumulateWithNanIgnore
<
reduce
::
Add
,
AccDataType
>>
;
template
<
typename
CThreadBuffer
>
__host__
__device__
static
void
Run
(
CThreadBuffer
&
in_thread_buf
,
void
*
__restrict__
p_
sha
red
,
void
*
__restrict__
p_softmax
)
Run
(
CThreadBuffer
&
in_thread_buf
,
void
*
__restrict__
p_red
uce
,
void
*
__restrict__
p_softmax
)
{
// printf("in_thread_desc: {%d, %d, %d}", in_thread_desc.GetLength(I0).value,
// in_thread_desc.GetLength(I1).value, in_thread_desc.GetLength(I2).value);
auto
reduce_work_buf
=
make_dynamic_buffer
<
AddressSpaceEnum
::
Lds
>
(
static_cast
<
AccDataType
*>
(
p_
sha
red
),
BlockSize
);
static_cast
<
AccDataType
*>
(
p_red
uce
),
BlockSize
);
auto
softmax_lds_buffer
=
make_dynamic_buffer
<
AddressSpaceEnum
::
Lds
>
(
static_cast
<
AccDataType
*>
(
p_softmax
),
MPerBlock
*
2
);
...
...
@@ -125,7 +123,7 @@ struct BlockwiseSoftmax_V1
// block reduce for max
BlockwiseMaxReduce
::
Reduce
(
reduce_work_buf
,
max_value_buf
(
I0
));
block_sync_lds
();
// save max value
// save max value
to lds
if
(
0
==
thread_k_cluster_id
)
{
softmax_lds_buffer
(
softmax_buf_desc_m_k
.
CalculateOffset
(
...
...
@@ -160,7 +158,7 @@ struct BlockwiseSoftmax_V1
BlockwiseSumReduce
::
Reduce
(
reduce_work_buf
,
accu_value_buf
(
I0
));
block_sync_lds
();
// save sum
// save sum
to lds
if
(
0
==
thread_k_cluster_id
)
{
softmax_lds_buffer
(
softmax_buf_desc_m_k
.
CalculateOffset
(
...
...
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