Even if the mxGPUArray.h is added to the include path. The library is not linked.
Solution is following:https://www.mathworks.com/matlabcentral/answers/294938-cannot-find-lmwgpu
The error message is as follows:
/tmp/mex_7501987706806805_32017/caffe_.o: In function mx_mat_to_blob(mxArray_tag const*, caffe::Blob<float>*, WhichMemory)':
mxIsGPUArray’
caffe_.cpp:(.text+0xc5): undefined reference to
caffe_.cpp:(.text+0xce): undefined reference to mxInitGPU'
mxGPUCreateFromMxArray’
caffe_.cpp:(.text+0xd6): undefined reference to
caffe_.cpp:(.text+0xe1): undefined reference to mxGPUGetDataReadOnly'
mxGPUGetNumberOfElements’
caffe_.cpp:(.text+0xf4): undefined reference to
caffe_.cpp:(.text+0x1a7): undefined reference to mxIsGPUArray'
mxGPUDestroyGPUArray’
caffe_.cpp:(.text+0x1b3): undefined reference to
/tmp/mex_7501987706806805_32017/caffe_.o: In function blob_set_data(int, mxArray_tag**, int, mxArray_tag const**)':
mxIsGPUArray’
caffe_.cpp:(.text+0x434): undefined reference to
collect2: error: ld returned 1 exit status
Makefile:508: recipe for target ‘matlab/+caffe/private/caffe_.mexa64’ failed
make: * [matlab/+caffe/private/caffe_.mexa64] Error 255