How do I perform muliple FFTs on a stack of data in parallel on a GPU?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I have a stack of images, and I want to compute the 2d fourier-transform of each image in parallel. For example, if I was not using a GPU, I would be doing something like this:
A = rand(256,256,100);
B = zeros(256, 256, 100);
for j = 1:100
B(:,:,j) = fftshift(fft2(A(:,:,j)));
end;
I would like to do each iteration of this for-loop in parallel. Is there a way to do that using gpuArray and arrayfun, or do I have to define my own cuda kernel?
0 件のコメント
回答 (1 件)
Edric Ellis
2013 年 3 月 18 日
FFT2 in MATLAB already applies to each 'page' of a 3-dimensional array, and this is true on the GPU too. Unfortunately, FFTSHIFT doesn't work that way, so you need something like this:
A = gpuArray.rand(256, 256, 100);
B = fftshift(fftshift(fft2(A), 1), 2);
参考
カテゴリ
Help Center および File Exchange で GPU Computing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!