I am trying to relocate my generated CUDA code to another environment. In that environment, I received an error about a missing header file "cublas_v2.h".
So I tried to use packNgo to make sure that I have all dependencies packaged into an archive. However, I get the following warning that packNgo cannot find the external CUDA files:
cfg = coder.gpuConfig('dll');codegen -config cfg My_Function;cd codegen/dll/My_Function;load buildInfo.matpackNGo(buildInfo,'packType', 'flat', 'fileName','portMy_Function');Warning: The following error occurred while attempting to run the preprocessorto find the minimum needed set of include files:While parsing the source file '...\codegen\dll\My_Function\My_Function_data.cu'the following error occurred:...\codegen\dll\My_Function\My_Function_types.h:31:cannot open source file "cublas_v2.h"| #include "cublas_v2.h"| ^
Best Answer
This is a known limitation. PackNGo is supported with GPU Coder only with 'MinimalHeaders' set to false.
See the following documentation page for more information:
https://www.mathworks.com/help/releases/R2020a/gpucoder/ug/package-code-for-other-development-environments.html
Hint: the external CUDA files can be found at the following location:
$matlabroot$\sys\cuda\win64\cuda\include