How to execute fft's with gpu,cuda in parallel (spmd)?

조회 수: 1 (최근 30일)
Greg
Greg 2013년 6월 12일
I have IxJxL single type data volume. I want to execute 1-D fft's of L length IxJ times.
Win7-64,GFX670,MatlabR2012a
data_device = gpuArray(data);
Nested 'for' loop on GPU works slower than on CPU.
for ii = 1:I
for jj = 1:J
data_device(ii,jj,:) = fft(data_device(ii,jj,:));
end
end
'Parfor' works even slower than simple 'for' loop.
1 Is there a way to use spmd method on GPU alike its done on CPU? How?
2 What is the optimal size of data to be send to GPU, considering params gpuDevice() function retuns?

채택된 답변

Edric Ellis
Edric Ellis 2013년 6월 12일
MATLAB's FFT function can operate along any single dimension. So you can simply do:
data_device = fft(data_device, [], 3);
rather than having a loop. See the FFT reference page for more.
  댓글 수: 3
Ben Tordoff
Ben Tordoff 2013년 6월 17일
Hi Greg, assuming you mean a GTX670, it actually has 1344 cores (7 processors, each with 192 cores). However, you cannot address a core individually. Infact you can't even address a processor individually. You need to send the GPU one big operation to perform and let it work out how to split it over the heirarchy of symmetric multi-processors and the cores they contain.
Our recommendation is always to send as much work (and data) in a single command as you can.
Greg
Greg 2013년 9월 21일
Ben, thanks a lot.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 GPU Computing in MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by