for-loop GPU Parallelization
1 view (last 30 days)
Show older comments
I was wondering whether there is a way to parallelize a for-loop such that each GPU core runs one in parallel. I have access to the Parallel Computing Toolbox v2011a, and of course any freely available files, if all I have to do is download them into a folder (e.g. GPUmat).
More specifically, I want to drive multiple systems to equilibrium independently, with each system consisting mainly of an array.
As far as I know, there is no way to do such a thing explicitly with the Toolbox? I tried circumventing this by defining a gpu-array "index" [1 2 3 ... N ] and using arrayfun on the array. The problem I ran into was arrayfun won't let me run loops on the GPU. Furthermore, I'm not sure what this exactly does to each GPU core.
I also tried GPUmat's compiler, which won't let me call indices of arrays. It's also not completely clear whether the GPUfor loop is a parallel for-loop.
0 Comments
Answers (1)
Jill Reese
on 27 Dec 2011
R2011a does support loops with arrayfun executing on the GPU. Without knowing more details about the code you'd like to execute on the GPU it's hard to provide suggestions on how to proceed. Could you add a code snippet to your post?
2 Comments
See Also
Categories
Find more on GPU Computing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!