[Openmp-commits] [PATCH] D77412: [OpenMP] Introduce stream pool to make sure the correctness of device synchronization

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Apr 10 17:47:48 PDT 2020


tianshilei1992 added inline comments.


================
Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:540
       CUDA_ERR_STRING(err);
     }
   }
----------------
jdoerfert wrote:
> tianshilei1992 wrote:
> > jdoerfert wrote:
> > > I was expecting this to be part of the StreamManager. If it can only happen at this point, maybe we want a `StreamManager::initializeDevice` method or similar. We can then also avoid exposing the stream pool to the outside. 
> > Yes, we could do that. But what I'm thinking is, do we assume `cuCtxSetCurrent` is called before we call `StreamManager::initializeDevice`, or we will set the context again in `StreamManager::initializeDevice`?
> Once could move both to the `StreamManager::initializeDevice`, set ctx and create streams. One could then either reset the context or just document that the context is set by `initializeDevice`. This is a one time cost so setting the context twice is not my main concern.
Yes, in the next patch, all these issues are no long existing. Here let's assume that when call `StreamManager::initializeDevice`, the right context has been set.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77412/new/

https://reviews.llvm.org/D77412





More information about the Openmp-commits mailing list