# does cuCtxPushCurrent / cuCtxPopCurrent  enforce implicit syncronization?

**URL:** <https://forums.developer.nvidia.com/t/does-cuctxpushcurrent-cuctxpopcurrent-enforce-implicit-syncronization/54874>\
**Category:** Container: CUDA\
**Created:** [November 5, 2017, 6:53am UTC](https://forums.developer.nvidia.com/t/does-cuctxpushcurrent-cuctxpopcurrent-enforce-implicit-syncronization/54874 "2017-11-05T06:53:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aviyach](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@aviyach](https://forums.developer.nvidia.com/u/aviyach)\
**Post date:** [November 5, 2017, 6:53am UTC](https://forums.developer.nvidia.com/t/does-cuctxpushcurrent-cuctxpopcurrent-enforce-implicit-syncronization/54874/1 "2017-11-05T06:53:05Z")

</div>

I’m using 2 cuda contexts in the same application (same thread).  
one is the primary context used for various calculations, and the other one is manually created for nvenc use.

without having a call to cudaDeviceSynchronize, I got wired issues and error in bout contexts.

I’m using push & pop whenever im using the non primary context.

this make me wonder, does cuCtxPushCurrent enforce the primary context to finish all its jobs?  
does cuCtxPopCurrent enforce the other context to finish all its jobs?

thanks!  
Aviya.

---

<div class="post-metadata">

**Author:** ![gcrider](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/gcrider/32/14043_2.png) [@gcrider](https://forums.developer.nvidia.com/u/gcrider)\
**Post date:** [November 8, 2017, 12:38am UTC](https://forums.developer.nvidia.com/t/does-cuctxpushcurrent-cuctxpopcurrent-enforce-implicit-syncronization/54874/2 "2017-11-08T00:38:42Z")

</div>

The correct forum for this question can be found at [https://devtalk.nvidia.com/default/board/57/cuda-programming-and-performance/](https://devtalk.nvidia.com/default/board/57/cuda-programming-and-performance/) .

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:28pm UTC](https://forums.developer.nvidia.com/t/does-cuctxpushcurrent-cuctxpopcurrent-enforce-implicit-syncronization/54874/3 "2021-10-12T16:28:53Z")

</div>

Closed on October 12, 2021, 4:28pm UTC


