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_ROCM
Commits
b398481e
Commit
b398481e
authored
Feb 29, 2024
by
Adam Osewski
Browse files
Fix synchronization scheme.
parent
91343ec1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
include/ck/utility/work_scheduling.hpp
include/ck/utility/work_scheduling.hpp
+4
-2
test/work_scheduling/test_strided_reduction_tile_loop.cpp
test/work_scheduling/test_strided_reduction_tile_loop.cpp
+1
-1
No files found.
include/ck/utility/work_scheduling.hpp
View file @
b398481e
...
@@ -116,7 +116,7 @@ class StridedReductionTileLoop
...
@@ -116,7 +116,7 @@ class StridedReductionTileLoop
index_t
neighbour_count
=
0
;
index_t
neighbour_count
=
0
;
if
(
tiles_per_block_
<
k_tiles
)
if
(
tiles_per_block_
<
k_tiles
)
{
{
// Since we can have deviation (+1) in neighbours number
// Since we can have deviation (+
/-
1) in neighbours number
// we calculate how many workgroups are needed to process the k-tiles left.
// we calculate how many workgroups are needed to process the k-tiles left.
neighbour_count
=
(
k_tiles
-
k_tile_idx
-
1
+
tiles_per_block_
-
1
)
/
tiles_per_block_
;
neighbour_count
=
(
k_tiles
-
k_tile_idx
-
1
+
tiles_per_block_
-
1
)
/
tiles_per_block_
;
}
}
...
@@ -139,7 +139,9 @@ class StridedReductionTileLoop
...
@@ -139,7 +139,9 @@ class StridedReductionTileLoop
if
(
neighbour_count
>
0
)
if
(
neighbour_count
>
0
)
{
{
finished_block_flags_
.
wait_lt
(
// Also count this workgroup
neighbour_count
++
;
finished_block_flags_
.
wait_eq
(
GetWorkgroupFlagIdx
(
k_tiles
,
output_tile_idx
,
output_tile_idx_offset
),
GetWorkgroupFlagIdx
(
k_tiles
,
output_tile_idx
,
output_tile_idx_offset
),
neighbour_count
);
neighbour_count
);
}
}
...
...
test/work_scheduling/test_strided_reduction_tile_loop.cpp
View file @
b398481e
...
@@ -156,7 +156,7 @@ __global__ void grouped_gemm_naive_strided_tile_loop_reduce(const GemmArgDesc* p
...
@@ -156,7 +156,7 @@ __global__ void grouped_gemm_naive_strided_tile_loop_reduce(const GemmArgDesc* p
// Accumulate partial results. We can have different # of workgroups to reduce, thus we
// Accumulate partial results. We can have different # of workgroups to reduce, thus we
// read actual flag value.
// read actual flag value.
for
(
index_t
i
=
1
;
i
<
=
neighbour_count
;
++
i
)
for
(
index_t
i
=
1
;
i
<
neighbour_count
;
++
i
)
{
{
partial_result
+=
p_workspace
[(
get_block_1d_id
())
*
MPerBlock
*
NPerBlock
+
partial_result
+=
p_workspace
[(
get_block_1d_id
())
*
MPerBlock
*
NPerBlock
+
i
*
MPerBlock
*
NPerBlock
+
get_thread_local_1d_id
()];
i
*
MPerBlock
*
NPerBlock
+
get_thread_local_1d_id
()];
...
...
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