Dear all,
How I can use stream in dependent routines calls, I mean by dependent that one routine need the results from the anothor. I have the following example code, but I don't get the correct results. There is any way to make it work properly.
cudaStream_t stream[2];
cudaStreamCreate( &stream[0] ) ;
cudaStreamCreate( &stream[1] ) ;
magmablasSetKernelStream(stream[0]);
magmablas_slacpy( MagmaUpperLower, M, N, d_H2s, M32, d_B, M232 );
magmablasSetKernelStream(stream[1]);
magma_sgeqrf_gpu( M2, M, d_B, M232, tau, d_T, &info);
cudaStreamDestroy( stream[0] ) ;
cudaStreamDestroy( stream[1] ) ;
Thanks
Using streams
Re: Using streams
If there is a dependency, both functions should be scheduled on the same stream, or you need to use CUDA synchronization between the functions, e.g., cudaStreamSynchronize or cudaEventSynchronize.
The purpose of using different streams for functions would be if there was no dependency and thus the functions could run in parallel, which is not the case here.
-mark
The purpose of using different streams for functions would be if there was no dependency and thus the functions could run in parallel, which is not the case here.
-mark
Re: Using streams
Thanks for the info, very useful.