how does cublas implement asynchronous scalar variable transmission

淺唱寂寞╮ 提交于 2019-12-25 02:11:52

问题


in many cublas or cusparse function calls, they use scalar variables which we can pass in either host pointer or device pointer, such as the alpha and beta variable here http://docs.nvidia.com/cuda/cublas/#cublas-lt-t-gt-gemm

How is this actually implemented? If the data is in host, I assume it would need to allocate memory on device and then call cudaMemcpyAsync to copy the data. However, doing cudaMalloc would make the function call synchronous. How can we solve this problem?


回答1:


If its a host resident scalar it can be passed by value as a kernel parameter. If it's device resident then a pointer to it can be passed as a kernel parameter.



来源:https://stackoverflow.com/questions/21766505/how-does-cublas-implement-asynchronous-scalar-variable-transmission

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