Converting parfor operations to gpuArray

I have a working parallel version of a code that does some likelihood calculations on a reasonably large matrix in parallel (using parfar) It is a trivially parallel operation as the calculation is performed column-wise & the parfor is employed to operate on the columns of data (one worker per column)
How could I achieve the same thing using a GPU (since the matrix is quite big & I have limited number of workers). All the operations are all GPU supported functions (matrix algebra ones like eig, diag & matrix multiplications only )
ie.,
data = 1000 by 200 (1000 rows by 200 cols matrix)
[nrows, ncols] = size(data);
parfor ix = 1:ncols
workerData = data(:,ix);
likelihood(ix) = funcCalcLikelihood(workerData, params);
end
This is fast enough. But i need to repeat such calculations many times so as to do a parameter sweep, so any speed increment will be good. Also, since my dataset is getting bigger (ncols = 1500 & I only have 144 max workers)
I have 2 Tesla (c2050) GPUS and was wondering if I could convert this into a gpuArray operation.
Thanks for your inputs.

댓글 수: 3

Edric Ellis
Edric Ellis 2013년 8월 6일
편집: Edric Ellis 2013년 8월 6일
Does it work simply to convert put 'data' on the gpu by calling gpuArray? gpuArrays can automatically flow in and out from PARFOR loops (providing a GPU is available on the client machine and the workers). Whether or not that is the most efficient thing you could do depends rather on the contents of 'funcCalcLikelihood'.
nah
nah 2013년 8월 19일
Thanks +Edric Ellis or your comment. I didn't quite get what you mean by converting put data though. Calling gpuArray automatically slices the big matrix by columns you mean ?
nah
nah 2013년 9월 6일
Any updates on this, anyone ?

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

질문:

nah
2013년 8월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by