I got error while executing this solution

1 回表示 (過去 30 日間)
nelson
nelson 2017 年 7 月 24 日
回答済み: Walter Roberson 2017 年 7 月 25 日
tic
k = gpuArray(1:0.5:10);
a = gpuArray(1:0.5:5);
n1 = numel(k);
n2 = numel(a);
numpl = repmat(k, 1, n2)';
denpl = repmat([ones(n2,1), a.', zeros(n2,1)] ,n1, 1);
w=[.1,.5,.8,1,2,8,15,50,100];
P=freqcp(numpl,denpl,w);
plottmpl(w,w,P);
gpu_time=toc
  7 件のコメント
Walter Roberson
Walter Roberson 2017 年 7 月 24 日
Adam
Adam 2017 年 7 月 24 日
Use the debugging 'Stop on errors' option from the Breakpoints menu, then you will see instantly what the problem is.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 7 月 25 日
That code was not designed to expect the possibility that the data was on the GPU.
Please see attached for a modified version that gather()'s the data it needs.
Note: execution of this code also requires the following functions from http://www.codeforge.com/article/216700
bndsdef.m freqcp.m qatan4.m qftdefs.m qsubset.m repltest.m
Grabbing the source is a minor nuisance if (like me) you do not have a codeforge account -- you cannot just copy and paste the source.

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by