Skip to content

[BUG] Incorrect Stride Calculation in AffineRank2RowMajor::packed() #2991

@aizyler

Description

@aizyler

Which component has the problem?

CUTLASS C++

Bug Report

Describe the bug
The packed() static method in AffineRank2RowMajor class incorrectly calculates strides for row-major matrix layout. Both AffineRank2RowMajor::packed() and AffineRank2ColumnMajor::packed() methods currently return the same parameters (1, extent.row()), which is only correct for column-major layout.

Steps/Code to reproduce bug
// Row-major version (INCORRECT)
static AffineRank2RowMajor packed(MatrixCoord const &extent) {
return AffineRank2RowMajor(1, extent.row()); // Wrong parameters
}

// Column-major version (CORRECT)
static AffineRank2ColumnMajor packed(MatrixCoord const &extent) {
return AffineRank2ColumnMajor(1, extent.row()); // Correct for column-major
}

Expected behavior
// Fixed row-major implementation
static AffineRank2RowMajor packed(MatrixCoord const &extent) {
return AffineRank2RowMajor(extent.column(), 1); // stride_row = num_cols
}

// Column-major remains correct
static AffineRank2ColumnMajor packed(MatrixCoord const &extent) {
return AffineRank2ColumnMajor(1, extent.row()); // stride_col = num_rows
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions