Sparse Matrix-Vector Multiplication
2026/3/9小于 1 分钟
Sparse Matrix-Vector Multiplication
题面
Implement a GPU program that performs sparse matrix-vector multiplication. 给定稀疏矩阵 A∈R^{M×N} 与稠密向量 x∈R^{N},计算 y = A x(长度 M)。
Implementation Requirements
- Use only GPU native features (external libraries are not permitted)
- The solve function signature must remain unchanged
- The final result must be stored in vector y
Examples
Example: A (3×4), x=[1,2,3,4] → y=[9,13,16]Constraints
- 1 ≤ M, N ≤ 10,000
- A 约 60–70% 稀疏(零元素占比 60–70%)
- Performance is measured with M = 1,000, N = 10,000