Hi @ptrblck, may I ask a follow-up question.

If you are running the code on a GPU and call p1 and p2 after each other, these calls will be queued onto the device and executed asynchronously. Depending on the workload of p1 , p2 might start while p1 is still executing.

So in the case of single-GPU, p1 and p2 could run in parallel depending on the workload, and this is great since we don’t have to code any particular logic to make them run in parallel.

If you have multiple GPUs in your system (and don’t use data parallel), you could execute p1 and p2 on each device and concatenate the result back on a single device.

But I’m not clear about the 2nd part of your answer, do you mean in the case of multiple-GPU, we need to explicitly code the logic (e.g. moving p1 to device1, and p2 to device2) to make them run in parallel?