How to use GPU cores in matlabpool?
4 views (last 30 days)
Show older comments
Hello, I am new to GPU computing. From what I read so far about matlabpool is that using "parfor" one can make his code parallel. But the maximum number of worker which can be allocated is 12. I have a GPU with 488 cores, how do I use these cores to create more workers? Is such thing possible?
0 Comments
Answers (1)
Matt J
on 24 Jun 2014
Edited: Matt J
on 24 Jun 2014
No, GPU cores don't work like CPU cores and are not capable of serving as parfor workers.
To exploit the GPU, you use the gpuArray command to create matrices and arrays that reside on, and are manipulated by, the GPU with greater speed than normal MATLAB matrices.
The GPU does not give you the same flexibilty as parfor in terms of the kinds of operations that you can parallelize. You can only do operations that are defined for gpuArray objects.
2 Comments
Matt J
on 24 Jun 2014
Edited: Matt J
on 24 Jun 2014
- No, as I said, GPU cores cannot serve as matlabpool/parpool workers.
- There is a list here of allowable functions that can be used inside gpuArray's arrayfun method. Further calls to arrayfun are not among them.
The operations that you are doing don't sound well-suited to the GPU, unless there's a way to vectorize that double for-loop.
See Also
Categories
Find more on GPU Computing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!