Skip to content

Conversation

@katherineding
Copy link

Since CUBLAS uses column-major order, a 1D vector initialized as {1,2,3,4} should be interpreted as the matrix
|1 3|
|2 4|.
This is confirmed by the cuda output:
|1 3| |5 7| |23 31|
|2 4| dot |6 8| = |34 46|

@mnicely
Copy link
Collaborator

mnicely commented Feb 24, 2022

Thanks @katherineding, I'll get this fixed updated soon.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR corrects documentation comments in the cuBLAS GEMM example to accurately reflect CUBLAS's column-major memory layout. The comments describing matrices A and B were updated to show that the 1D array {1,2,3,4} represents a matrix with elements arranged column-wise (i.e., first column is [1,2], second column is [3,4]), rather than row-wise as previously documented. This change makes the comments consistent with CUBLAS conventions, where matrices are stored in column-major (Fortran-style) order, and aligns the documentation with the actual computed output C = [[23,31],[34,46]]. No code logic was modified—only explanatory comments were updated to prevent confusion for developers learning to work with CUBLAS's memory layout conventions.

Changed Files
Filename Score Overview
cuBLAS/Level-3/gemm/cublas_gemm_example.cu 5/5 Fixed matrix representation comments to correctly show column-major order used by CUBLAS

Confidence score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects that only documentation comments were changed with no modifications to executable code, and the corrected comments now accurately describe the column-major matrix layout that CUBLAS uses
  • No files require special attention

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@kvoronin
Copy link
Collaborator

Hi @katherineding!

We have changed the license of the repository from BSD-3 to Apache 2.0 to allow accepting external contributions in the right way.

What this means is that

  • the new default branch is main. (The old one called master is still there, but master and an extra bsd3_main are not supposed to be changed)
  • all commits to the repository must be signed, see the new https://github.com/NVIDIA/CUDALibrarySamples/blob/main/CONTRIBUTING.md. Technically, it is as simple as doing git commit -s ... which would enforce DCO for the contribution (see more details in the CONTRIBUTING.md).

What this means for this PR:

  • If the changes from this PR have not been merged into the former master branch (now called main), please change the target branch to main (potentially instead of rebase it is easier to cherry-pick commits into a new branch) and sign the commits.
  • If they were, feel free to ignore this message. In this case, @mnicely, should we close this PR?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants