GPU CODER Unresolved extern function '_Z22mwGet​GlobalThre​adIndexv'

조회 수: 1 (최근 30일)
jelin leslin
jelin leslin 2020년 6월 5일
답변: Chao Luo 2020년 7월 6일
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.

답변 (1개)

Chao Luo
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

카테고리

Help CenterFile 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!

Translated by