Back to Collectives and shuffles
lanes_matvec
The lanes_matvec kernel, as the compiler built it for sm_75 at commit 5a313cd: K = 256, N = 32; a grid of 8 CTAs, 128 threads each.
@launch(128)@aligned(K = 128)kernel lanes_matvec(W: tensor<f32>[N, K], x: tensor<f32>[1, K], y: tensor<f32>[1, N]) { let row = ctx.block.x * ctx.warps + ctx.warp var acc: f32 = 0.0 if row < N { for k in range(0, K, ctx.lanes * 4) { let at = k + ctx.lane * 4 acc += sum(W[row, at :+ 4] * x[0, at :+ 4]) } } let total = sum<over ctx.lane>(acc) if ctx.lane == 0 && row < N { y[0, row] = total }}A kernel written in the docs
CTA 0
- global memory
- shared memory
- threads and lanes
- extra 128-byte lines, masked elements
Keys: left and right arrows step, space plays and pauses; play runs on from the last step to the first. The address of this page keeps the step, the CTA and the zoom.