for-loop GPU Parallelization
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Jill Reese
2011-12-27
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?
另请参阅
类别
在 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!