Sparse arrays on GPU?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ajay Shenoy
am 18 Jul. 2015
Bearbeitet: Amin zaami
am 7 Jun. 2022
Hello,
According to the Matlab documentation ( http://www.mathworks.com/help/distcomp/run-built-in-functions-on-a-gpu.html ), I can create a sparse gpuArray by "either by calling sparse with a gpuArray input, or by calling gpuArray with a sparse input." Neither of these seems to work:
x = sparse([0 2 0; 0 5 0; 0 1 0])
x =
(1,2) 2
(2,2) 5
(3,2) 1
m = gpuArray(x)
Error using gpuArray
Only full arrays of fundamental numeric types or logical types are supported for
GPU arrays.
Or alternatively:
x = gpuArray([0 2 0; 0 5 0; 0 1 0])
x =
0 2 0
0 5 0
0 1 0
X = sparse(x)
Undefined function 'sparse' for input arguments of type 'gpuArray'.
Am I doing something wrong?
Thanks!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Amin zaami
am 7 Jun. 2022
Bearbeitet: Amin zaami
am 7 Jun. 2022
See example below for sparse on GPU:
sparse(41200,41200,gpuArray(1),41200,41200);
- first 2 arguments for size, last two for memory,
0 Kommentare
Siehe auch
Kategorien
Mehr zu GPU Computing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!