Reading BLAS names
BLAS (Basic Linear Algebra Subprograms) routine names look cryptic — gemv, ger,
syr2, gemm — but they are systematic: each name is a compressed description
of what the routine does. Once you can read the pieces, the names are
self-documenting and easy to remember. This page is the key.
The three levels
Section titled “The three levels”BLAS is organized into levels by how much arithmetic a routine does relative to the data it touches — which is exactly what decides whether it is memory-bound or compute-bound, and how it tiles:
| level | shape | work / data | examples |
|---|---|---|---|
| Level 1 | vector–vector | / | axpy, dot, nrm2, scal |
| Level 2 | matrix–vector | / | gemv, ger, symv, syr |
| Level 3 | matrix–matrix | / | gemm |
Level 3 is the prize: work on only data means each element is
reused times, so it tiles with high arithmetic intensity — the reason
gemm dominates DL compute.
Anatomy of a name
Section titled “Anatomy of a name”A Level-2/3 name is three fields glued together: [type][structure][operation].
Field 1 — data type (dropped throughout this catalog, where everything is real):
s | d | c | z |
|---|---|---|---|
| single | double | complex | double complex |
Field 2 — matrix structure — which part of the matrix actually carries data:
ge | sy | he | tr | gb / sb / tb |
|---|---|---|---|---|
| general | symmetric | Hermitian | triangular | banded |
Field 3 — operation:
mv | mm | r | r2 | sv |
|---|---|---|---|---|
| matrix–vector product | matrix–matrix product | rank-1 update | rank-2 update | triangular solve |
Read left to right and the name expands itself:
gemv=ge+mv= GEneral Matrix–Vector productger=ge+r= GEneral Rank-1 updatesyr2=sy+r2= SYmmetric Rank-2 updategemm=ge+mm= GEneral Matrix–Matrix product
The catalog, decoded
Section titled “The catalog, decoded”Level 1 — the names predate the field scheme, so they are mnemonics rather than
[type][structure][op]:
| name | reads as | operation |
|---|---|---|
axpy | a·x plus y | |
dot | dot product | |
nrm2 | norm, 2-norm | |
asum | absolute sum | |
scal | scale | |
swap | swap | |
copy | copy | |
rot | (Givens) rotation | apply a plane rotation to |
iamax | index of abs max |
Level 2 — [structure][operation]:
| name | expands to | operation |
|---|---|---|
gemv | general matrix–vector | |
ger | general rank-1 | |
trmv | triangular matrix–vector | |
symv | symmetric matrix–vector | , |
syr | symmetric rank-1 | |
syr2 | symmetric rank-2 |
Level 3:
| name | expands to | operation |
|---|---|---|
gemm | general matrix–matrix |
Why the shorthand helps here
Section titled “Why the shorthand helps here”In the domain-flow view the name’s fields often predict the recurrence shape:
- the operation field tells you the index-space geometry —
mvis a reduction (a matvec contracts an axis),r/r2are fully-parallel outer products (a rank update has no reduction), andmmis the full 3-D reduction cube; - the structure field tells you the matrix is referenced only in a triangular
half —
sy/heexploit symmetry to read half the elements,tris triangular. For the rank updatessyr/syr2this restricts the writes too, so their domain of computation is a triangular prism rather than a box; the matrix–vector casessymv/trmvstill produce a full vector, they just read half the matrix.
So gemv and ger being adjacent in the catalog is not a coincidence: they are the
inner-product and outer-product halves of the same matrix–vector interaction, and
their SUREs are almost mirror images (a reduction vs. a broadcast-only map).