Can different Kernel share same memory?

Hello everyone,

Suppose I have 2 kernel, kernalA and kernelB execute with following sequence on same stream:

KernelA(const T* inA, T* outA)
KernelB(const T* inB, ToutA, ToutB)

My question is,after KernelA finished,is outA memory writing finished?and can KernelB use outA directly without waiting?

At last, hope you guys safe during coronavirus time.

Kernels issued to the same stream execute in order, and these types of data dependencies work just fine. If these kernels execute in different streams, you will need explicit synchronization.