Medium
A kernel launched with no stream argument between two streamed kernels
kernelA and kernelB each launch only a handful of blocks, far too few to fill the GPU, and are independent of each other. The program is compiled with plain nvcc (no stream-related flags). The author expected A and B to overlap, but Nsight Systems shows A, then the log kernel, then B, strictly back to back. Why?
pipeline.cu
cudaStream_t s1, s2;
cudaStreamCreate(&s1);
cudaStreamCreate(&s2);
kernelA<<<8, 256, 0, s1>>>(bufA);
logKernel<<<1, 32>>>(stats); // added later for debugging
kernelB<<<8, 256, 0, s2>>>(bufB);
cudaDeviceSynchronize();33 of 46 in GPU / CUDA