MCPcopy Create free account
hub / github.com/KnowingNothing/MatmulTutorial / get_current_tile_for_idx

Method get_current_tile_for_idx

include/scheduler.h:38–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 }
37
38 DEVICE TileInfo get_current_tile_for_idx(int64_t idx) {
39 int64_t cluster_id = idx / (ClusterX * ClusterY); // ClusterZ should be 1
40 auto [block_m_in_cluster, block_n_in_cluster, _] = block_id_in_cluster();
41 int cluster_m = cluster_id / (problem_n / ClusterY);
42 int cluster_n = cluster_id - cluster_m * (problem_n / ClusterY);
43 int work_m = cluster_m * ClusterX + block_m_in_cluster;
44 int work_n = cluster_n * ClusterY + block_n_in_cluster;
45 return {work_m, work_n, idx < total_problem_mn};
46 }
47
48 DEVICE void advance(int count = 1) {
49 current_idx += gridDim.z * gridDim.y * gridDim.x * count;

Callers

nothing calls this directly

Calls 1

block_id_in_clusterFunction · 0.85

Tested by

no test coverage detected