Reputation: 3783
Can we improve performance by calculating some parts of CPU's parfor
or spmd
blocks using gpuArray
of GPU functions? Is this a rational way to improve performance or there are limitations in this procedure? I read somewhere that we can use this procedure when we have some GPU units. Is this the only way that we can use GPU computing besides CPU parallel loops?
Upvotes: 0
Views: 238
Reputation: 25140
It is possible that using gpuArray
within a parfor
loop or spmd
block can give you a performance benefit, but really it depends on several factors:
So, if you had two high-powered GPUs in your machine and ran two workers in a parallel pool on a problem that could keep a single GPU fully occupied - you'd expect to see good speedup. You might still get decent speedup if you ran 4 workers.
One thing that I would recommend is: if possible, try to avoid transferring gpuArray
data from client to workers, as this is slower than usual data transfers (the gpuArray
is first gather
ed to the CPU and then reconstituted on the worker).
Upvotes: 1