Slow SpMV (sparse matrix vector product) performance

조회 수: 5 (최근 30일)
Zheng Gu
Zheng Gu 2015년 5월 21일
답변: Zheng Gu 2015년 5월 22일
In R2014b, I am performing many SpMV operations using a sparse complex banded matrix with 9 elements per row, grouped in triplets (one triplet is a tridiagonal), and a dense complex vector with about 4 million elements. For some reason, it is extremely slow, taking around 10 seconds to do one on my Core i7 (2.66Ghz quad core) in Win7 x64. I've seen the CUDA libraries for SpMV, but do not have the parallel computing toolbox. Is there anything better to do than just a A*b to try to improve the awful performance?
Edit: I tried this individual command in the MATLAB console and it is about 30x faster (just over 0.3 seconds)! E.g., in my script, I have:
while x
tic
y = A*b;
toc
% other code
end
And in the console I have: tic; y=A*b; toc; And there is a 30x difference between the two. This is consistent and reproducible, but makes no sense to me. If anything, shouldn't the m-file be faster?

채택된 답변

Zheng Gu
Zheng Gu 2015년 5월 22일
Issue solved. This was a memory problem. I had used too much memory in the script and MATLAB needed to copy the data from the swap file in order to perform the SpMV.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by