cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[QST]From index into a coordinate (or coordniate into a index), it has two different implementations, how should one distinguish and understand the scenarios for their use?

Open Shan19900305 opened this issue 11 months ago • 1 comments

Implementations: 1)Function with stride: https://github.com/NVIDIA/cutlass/blob/main/include/cute/stride.hpp#L102 2)Function without stride: https://github.com/NVIDIA/cutlass/blob/main/include/cute/stride.hpp#L152

function with stride is easy to understand, but without stride, why need to compute like: i = c0 + s0 * (c1 + s1 * (c2 + s2 * ...))

How to use the last function, and also for idx2cor.

Shan19900305 avatar Feb 23 '25 07:02 Shan19900305

@Junkai-Wu

hwu36 avatar Mar 04 '25 03:03 hwu36

To calculate from a coord to an index, you need a shape and a stride. If the stride is explicitly provided, the function calculates the index using the given stride. If the stride is not provided by user, the function assume that the shape passed in the function is packed, which means shape (s0, s1, s2, s3) has stride (1, s0, s0 * s1, s1 * s2).

Junkai-Wu avatar Mar 13 '25 08:03 Junkai-Wu

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] avatar Apr 12 '25 09:04 github-actions[bot]

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

github-actions[bot] avatar Jul 11 '25 09:07 github-actions[bot]