Trying to use gpuArray for graph function
조회 수: 5 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Edric Ellis
2020년 5월 18일
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?
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!