Can I use GPU instead of CPU to run parfor-loop?
8 views (last 30 days)
I am trying to figure out how GPU works when it comes to parallelization.
Below is the part of the code that I am working on.
I usually rely on CPU parallelization. My CPU has 36 cores and as far as I understand, each worker is assigned with each outerloop (in this case 1 to Na is assigned to each worker)
And I was told about this GPU parallelization and Matlab supports GPU tasks. I read some documents but couldn't get how can it work so fast.
If I understand this correctly, a single GPU has more cores than CPU in usual. So I was wondering if GPU parallelization works in the same way by using spmd (each core of GPU is assigned with each loop).
parfor i_a = 1:Na
for i_d = 1:Nd
for i_y = 1:Ny
for i_t = 1:Nt
[adj_sol, adjval] = fminsearchbnd(@(x) ...
[A(1); D(1)],[A(end); D(end)],options);
Any help will be very much appreciated.