how to run Gpu and Cpu in parallel in for loop?
Mostrar comentarios más antiguos
for i=1:10
A(:,:,i)=rand(5,5);
[q1,r1]=qr(A(:,:,i));
end
I wanted cpu and gpu's to communicate with itself about the loop index. For iteration 1, cpu is working, gpu1 should also simultaneously work on iteration 2. gpu 2 should also simultaneously work on iteration 2. If gpu1 completes its task early, it should start iteration 3. When cpu is done with iteration 1, it should proceed with iteration 4 and so on. How should we implement this. The cpu, gpu1,gpu2 should only communiate about the loop index 'i' and not the A matrix. Once cpu or either of gpu's completes its iteration, it should parallely update the output array. How should this be implemented ?
6 comentarios
OCDER
el 14 de En. de 2019
Homework? Looks very similar to this post...
Walter Roberson
el 14 de En. de 2019
is this a homework assignment or did you repost?
madhan ravi
el 14 de En. de 2019
Naveen kumar Elumalai
el 14 de En. de 2019
Editada: Naveen kumar Elumalai
el 14 de En. de 2019
OCDER
el 14 de En. de 2019
Just curious, why do you want to split the job as such? Do you want GPU and CPU to be treated as indistinguishable processors? I foresee an issue where you must continuously exchange an array from a normal array to gpuArray, which can create a lot of overhead and slow things down.
Example of job tasks you want?
Task# CPU1 CPU2 GPU1 GPU2
1 X
2 X
3 X
4 X
5 X
6 X
7 X
8 X
9 X
10 X
11 X
Naveen kumar Elumalai
el 14 de En. de 2019
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Parallel Computing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!