A third party CUDA MEX file could be built with a different version of the CUDA toolkit, and thus a different version of the CUDA runtime. You will not be able to safely pass gpuArray objects into and out of the function.
To avoid this, obtain the source code and compile the function yourself using MEXCUDA.
That said, there's nothing to guarantee it won't work...but in this case it looks like your MEX function is resetting the device itself and thus destroying the CUDA context (for instance, it could be calling the CUDA C runtime function cudaDeviceReset). You won't be able to use it safely with gpuArray variables in your MATLAB workspace. Again, if you had access to the source code, you could modify this behaviour and even have MATLAB successfully respond to the reset event.
댓글 수: 3
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/717078-using-cuda-mex-files-interoperably-with-gpuarray#comment_1263493
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/717078-using-cuda-mex-files-interoperably-with-gpuarray#comment_1263493
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/717078-using-cuda-mex-files-interoperably-with-gpuarray#comment_1264675
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/717078-using-cuda-mex-files-interoperably-with-gpuarray#comment_1264675
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/717078-using-cuda-mex-files-interoperably-with-gpuarray#comment_1264690
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/717078-using-cuda-mex-files-interoperably-with-gpuarray#comment_1264690
댓글을 달려면 로그인하십시오.