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
98220c32
Commit
98220c32
authored
Oct 16, 2023
by
Adam Osewski
Browse files
Refactor out FlagCount function.
parent
991e44ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
include/ck/utility/work_scheduling.hpp
include/ck/utility/work_scheduling.hpp
+8
-4
No files found.
include/ck/utility/work_scheduling.hpp
View file @
98220c32
...
...
@@ -54,6 +54,13 @@ class StridedReductionTileLoop
return
tile_id_
<
tile_count_
&&
block_tile_idx_
<
tiles_per_block_
;
}
__device__
index_t
GetFlagCount
(
index_t
k_tiles
)
const
{
// This is the number of MN-output tiles which we cover with workgroups.
// We launch k_tiles (k_batch) / tiles_per_block workgroups for each output tile.
return
(
get_grid_size
()
*
tiles_per_block_
+
k_tiles
-
1
)
/
k_tiles
;
}
///
/// @brief Calculate this workgroup flag index.
///
...
...
@@ -71,10 +78,7 @@ class StridedReductionTileLoop
index_t
output_tile_idx
,
index_t
output_tile_idx_offset
)
const
{
// This is the number of MN-output tiles which we cover with workgroups.
// We launch k_tiles (k_batch) / tiles_per_block workgroups for each output tile.
const
index_t
flag_count
=
(
get_grid_size
()
*
tiles_per_block_
+
k_tiles
-
1
)
/
k_tiles
;
return
(
output_tile_idx
+
output_tile_idx_offset
)
%
flag_count
;
return
(
output_tile_idx
+
output_tile_idx_offset
)
%
GetFlagCount
(
k_tiles
);
}
///
...
...
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