To make it simpler, consider this function:
function testFun
a = gpuArray([1 1]);
gradient(a)
end
It works from inside Matlab, but when I deploy it:
mcc -m testFun.m
then the gradient function for gpuArray variables is no more recognized, and I get the following error message:
Error using gpuArray/gradient
MATLAB encountered an unexpected error in evaluation on the GPU.
This could be caused by an invalid path or a corrupted MATLAB installation.
Error in testFun (line 4)
parallel:gpu:array:MATLABFcnNotFound