Skip to content

Suggestion: Add roofline/arithmetic-intensity analysis to matrixMul samples #444

Description

@ragulk143

The matrixMul and matrixMulCUBLAS samples report GFLOPS and execution time, and matrixMulCUBLAS already compares a custom kernel against cuBLAS — both genuinely useful for learners.

Suggestion: extend these (or add a companion sample) that additionally:

  1. Implements the same GEMM at multiple optimization stages — naive, shared-memory tiled, and Tensor Core (WMMA) — so learners see the actual performance delta between each technique, not just a single implementation.
  2. Reports arithmetic intensity (FLOPs/byte) alongside achieved GFLOPS, plotted against the GPU's roofline (peak compute vs peak memory bandwidth), so learners can see whether their kernel is memory-bound or compute-bound.

I built a small reference implementation exploring this for my own learning, benchmarked on an RTX 3050: https://github.com/ragulk143/cuda-gemm

Happy to contribute a PR along these lines if this is something the maintainers would find valuable for the samples repo.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions