An event pool, similar to the stream pool, needs to be kept per device.
For one, events are associated with cuda contexts which means we cannot
destroy the former after the latter. Also, CUDA documentation states
streams and events need to be associated with the same context, which
we did not ensure at all.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
openmp/libomptarget/plugins/cuda/src/rtl.cpp | ||
---|---|---|
181–182 | I don't think it's good to put CUcontext in allocator. That template is only a reference for other specialization. |
openmp/libomptarget/plugins/cuda/src/rtl.cpp | ||
---|---|---|
181–182 | It was but it is not anymore. It is a base class now. Can you elaborate why you think it's not good to put a CUcontext in here? After all, all the associated allocators do allocate things that are bound to a/this context. |
openmp/libomptarget/plugins/cuda/src/rtl.cpp | ||
---|---|---|
181–182 | Well, it's not about correctness or necessity. It's just different styles. Like I said, it's just a reference/interface. All other allocators can implement in their own way, including some resources that don't require context. But of course you could argue we have not encountered any resource that doesn't require context. That's true and that's why I think it's just about styles. I'd like to keep things more flexible, even currently I don't see any use. |
I don't think it's good to put CUcontext in allocator. That template is only a reference for other specialization.