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

烈酒焚心 提交于 2019-11-28 08:15:50

问题


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...);

回答1:


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.



来源:https://stackoverflow.com/questions/13667685/will-the-cublas-kernel-functions-automatically-be-synchronized-with-the-host

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!