Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1.07 KB

File metadata and controls

35 lines (23 loc) · 1.07 KB

GEMV Kernel

The gemv operator computes the matrix-vector product of a matrix and a vector.

Mathematical Definition

Given an input matrix A and input vectors x and y, along with scalars α and β, the kernel evaluates

$$ y = \alpha A x + \beta y $$

The matrix-vector product is computed by multiplying the matrix A with the vector x, scaling the result by α, scaling the vector y by β, and then adding the two scaled results together to produce the updated vector y.

Kernel Implementations

All backends share the interface:

def gemv(A: torch.Tensor, x: torch.Tensor, y: torch.Tensor, alpha: float, beta: float) -> torch.Tensor:
    ...

Testing

See the test suite for the validation harness that exercises every backend.

pytest tests/test_gemv.py -s