Trying to use gpuArray for graph function
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
We are trying to use gpuArray's to speed up our graph function call but after converting 's' and 't' to gpuArray's the graph function has an error which we have been unable to move past.
The code, error and code output are below. Both gpuArray's are 28 rows with no zero's or negative numbers.
Any help is greatly appreciated.
Thanks
Code:
fprintf('t:')
t = gpuArray((table2array(edgedefs(:,5))))
class (t)
%t = gpuArray(t);
s = gpuArray((table2array(edgedefs(:,4))))
class(s)
%s = gpuArray(s)
w = table2array(edgedefs(:,3));
fprintf('Before Graph\n\n')
beforegraph = clock
G = graph(s, t)
Error message:
Error using matlab.internal.graph.MLGraph
Source must be a numeric array of positive integer node indices.
Error in matlab.internal.graph.constructFromEdgeList (line 218)
G = underlyingCtor(s, t, totalNodes);
Error in graph (line 300)
matlab.internal.graph.constructFromEdgeList(...
Error in a_2020_05_15_Sc (line 145)
G = graph(s, t)
Output:
>> t:
t =
398894
398895
398896
398897
398899
398900
398901
398902
398903
398904
398905
398906
398907
398908
398909
398910
398911
398912
398913
398914
398915
398916
398917
398918
398919
398920
398921
398922
ans =
'gpuArray'
s =
7754
7755
7756
7757
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
ans =
'gpuArray'
Before Graph
beforegraph =
2020 5 17 20 39 4.14
0 Commenti
Risposte (1)
Edric Ellis
il 18 Mag 2020
Unfortunately, graph does not support using gpuArray data in this way. Is there some specific algorithm on your graph that you're looking to speed up using the GPU?
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!