Accelerate eigs with GPU

35 ビュー (過去 30 日間)
Sven Auschra
Sven Auschra 2020 年 7 月 29 日
コメント済み: Bruno Luong 2020 年 7 月 30 日
Dear all,
I have implemented a numerical solver (of the Fokker-Planck equation) in MATLAB.
At some point, the algorithm needs to calculate
eigs(L, 1, 0)
of a very large sparse matrix L.
I would like to perform this calculation on a GPU to lower the computational costs. So, I created the array
Lgpu = gpuArray(L);
on the GPU and tried to calculate
eigs(Lgpu, 1, 0)
again.
Unfortunately, I receive the error message: "First argument must be a double matrix or a function."
I am wondering what the cause of this error might be and appreciate any help from you.
Thank you very much.
best,
Sven

回答 (2 件)

Christine Tobler
Christine Tobler 2020 年 7 月 30 日
編集済み: Edric Ellis 2020 年 7 月 30 日
The eigs function is not supported on the GPU. There is support for sparse matrices on the GPU, since R2015a: Release notes parallel computing toolbox.
You could pass a function handle to EIGS that would use computation on the GPU, but would need to accept and pass back out vectors on the CPU. I'm not sure how efficient that would be, but it could be worth a try.
  6 件のコメント
Sven Auschra
Sven Auschra 2020 年 7 月 30 日
Thank you so much for your support.
Unfortunately, calculations on the GPU (Kepler K20) are by a factor of 17 slower than on the CPU. So, I guess I will stick to calculating EIGS on the latter one.
Anyway, thank you so much. I really appreciate it.
Bruno Luong
Bruno Luong 2020 年 7 月 30 日
Yeah I would also expect any speedup using GPU. Mostly EIGS on sparse is mainly an iterative process in double layers. Nothing really leans for GPU computation.

サインインしてコメントする。


Walter Roberson
Walter Roberson 2020 年 7 月 29 日
There is no GPU support for sparse arrays.
  2 件のコメント
Edric Ellis
Edric Ellis 2020 年 7 月 30 日
This is no longer correct, support for sparse gpuArray was added in R2015a.
Walter Roberson
Walter Roberson 2020 年 7 月 30 日
Ah!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by