Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will the cublas kernel functions automatically be synchronized with the host?

Tags:

cublas

Just a general question about cublas. For a single thread, if there is not memory transfer from GPU to CPU (e.g. cublasGetVector), will the cublas kernel functions (eg cublasDgemm) automatically be synchronized with the host?

    cublasDgemm();
//cublasGetVector();
    host_functions()

Furthermore, what about between two adjacent kernel calls?

cublasDgemm();
cublasDgemm();

and, what about a synchronized transfer that does not involve the global memory used in the previous kernel?

cublasDgemm(...gA...gB...gC);
cublasGetVector(...gD...D...);
like image 401
Hailiang Zhang Avatar asked Dec 02 '12 08:12

Hailiang Zhang


1 Answers

No, the CUBLAS API is, with the exception of a few Level 1 routines which return a scalar value, asynchronous.

Level 3 routines like cublasDgemm don't block the host, you need to call a blocking API routine like a synchronous memory transfer or an explicit host-GPU synchronisation call to ensure that the CUBLAS call has completed.

like image 128
talonmies Avatar answered Sep 16 '22 21:09

talonmies