GPU CODER Unresolved extern function '_Z22mwGetGlobalThreadIndexv'
1 次查看(过去 30 天)
显示 更早的评论
I am trying to compile a mex GPU code in my matlab but I get this error(attached) .I had the same error when I compiled the GPU generated source code in Visual studio but I solved it by making rdc-true in Generate relocatable device code . I dont know how to resolve this in MATLAB.
0 个评论
回答(1 个)
Chao Luo
2020-7-6
Hi Jelin,
The issue is the generated CUDA code InformationFilterUpdate.cu calls a device function mwGetGlobalThreadIndex in another CUDA file, MWCudaDimUtility.cu. In this case, you need to pass "-rdc=true" to nvcc, and link the device code using nvcc.
I don't think mexcuda supports either of them. You can not pass flags to nvcc and you can not use nvcc to link the object files with mexcuda.
The solution I suggest is to modify InformationFilterUpdate.cu to copy the device functions it calls to the file. We have fixed this issue in the coming 20b release by moving the device functions to the header. For now, you can try replacing MWCudaDimUtility.hpp with the file I attached here, which is copied from 20b release.
Chao
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with GPU Coder 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!