For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
naive_gemv
def naive_gemv(c_buf: TileTensor[Storage=c_buf.Storage, address_space=c_buf.address_space, linear_idx_type=c_buf.linear_idx_type], a_buf: TileTensor[Storage=a_buf.Storage, address_space=a_buf.address_space, linear_idx_type=a_buf.linear_idx_type], b_buf: TileTensor[Storage=b_buf.Storage, address_space=b_buf.address_space, linear_idx_type=b_buf.linear_idx_type])
Computes a reference matrix-vector product C = A * b using a scalar nested loop.
Iterates over K then M, accumulating each A[m, k] * b[k] into c[m]. Intended for correctness testing rather than performance-critical paths.
Args:
- โc_buf (
TileTensor[Storage=c_buf.Storage, address_space=c_buf.address_space, linear_idx_type=c_buf.linear_idx_type]): Output TileTensor of length M, zero-filled on entry. - โa_buf (
TileTensor[Storage=a_buf.Storage, address_space=a_buf.address_space, linear_idx_type=a_buf.linear_idx_type]): Input matrix TileTensor of shape (M, K). - โb_buf (
TileTensor[Storage=b_buf.Storage, address_space=b_buf.address_space, linear_idx_type=b_buf.linear_idx_type]): Input vector TileTensor of length K.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!