[llvm] [Offload] Move RPC server handling to a dedicated thread (PR #112988)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 19 08:05:55 PDT 2024


jhuber6 wrote:

> I thought we just take advantage of the fact that when we finish launching the kernel, the thread (no matter whether it is helper thread or regular thread), it is waiting there anyway?

AFAIK, doing this is always unsound.
```
while (cuStreamQuery(Stream) == CU_STREAM_BLOCKED);
```
With the current implementation, you can use `CUDA_LAUNCH_BLOCKING=1` and it will deadlock. Also this is indicated by the fact that I needed to put other random places to make it sleep. If it's a truly async launch then there will be no helper thread, since presumably we want this API to be usable by non-OpenMP users someday.

https://github.com/llvm/llvm-project/pull/112988


More information about the llvm-commits mailing list