Segmentation fault when passing device pointer to cublasSnrm2

拜拜、爱过 提交于 2019-11-28 14:33:27

The problem is here:

cublasSnrm2(handle,row,dy,incy,de);

By default, the last parameter is a host pointer. So either pass e to the snrm2 call rather than de or do this:

cublasSetPointerMode(handle,CUBLAS_POINTER_MODE_DEVICE); 
stat = cublasSnrm2(handle,row,dy,incy,de);

The pointer mode needs to be set to device if you want to pass a device pointer to store the result.

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