构造函数作用:
CUTLASS_HOST_DEVICE
PredicatedTileAccessIterator(
Params const ¶ms,
Pointer pointer,
TensorCoord extent,
int thread_id,
TensorCoord const &threadblock_offset,
int const *indices = nullptr)
-
初始化参数:
params_ = params -
设置谓词:
the_predicates(extent) -
计算线程偏移:
set_predicates(thread_id, threadblock_offset) -
设置指针:
add_pointer_offset(...)
add_tile_offset方法:
两种模式:
- residue tile:第一个不完整 tile
- steady state:后续完整 tile
简化代码说明:
CUTLASS_DEVICE
void add_tile_offset(TensorCoord const &tile_offset) {
if (is_residue_tile_) {
// 1. 更新线程偏移
the_predicates.thread_offset_ += the_predicates.residue_offset_;
// 2. 重新计算谓词
the_predicates.compute_predicates_(extent, true);
// 3. 更新指针
add_pointer_offset(layout(residue_offset_));
// 4

最低0.47元/天 解锁文章
764

被折叠的 条评论
为什么被折叠?



