Commit 2697bd10 authored by Qianqian Fang's avatar Qianqian Fang
Browse files

avoid crashing matlab when no gpu found

parent ca2d2f80
......@@ -130,8 +130,11 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]){
if(strcmp(shortcmd,"gpuinfo")==0){
mcx_initcfg(&cfg);
cfg.isgpuinfo=3;
mcx_list_gpu(&cfg,&workdev,NULL,&gpuinfo);
try{
mcx_list_gpu(&cfg,&workdev,NULL,&gpuinfo);
}catch(...){
mexErrMsgTxt("OpenCL is not supported or not fully installed on your system");
}
if(!workdev){
mexErrMsgTxt("no active GPU device found");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment