How to formulate problem so Matlab can use GPU functionality?
古いコメントを表示
Often when I try to solve a problem and want to use the GPU I strugle to formulate the problem so Matlab can use GPU functionality.
Below is very simple example. I have a function with an array as input and I want to evaluate it with a large number of different parameters, in this example it's a filter that I want to test with different filter coefficients. It is possible to use "parfor" to parallelize it on the CPU. But how do I use the GPU to solve it?
.
X=sin((0:0.1:5)'); % Unfiltered signal
C = linspace(0,1,1e6)'; % Large number of filter coefficients
Y = zeros(length(X),length(C)); % Pre allocate storage for filtered signals
for k=1:length(C)
Y(:,k) = MyFilter(X,C(k)); % I want to parallelize this for-loop on the GPU
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で GPU Computing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!