| 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; |
nothing calls this directly
no test coverage detected