記調試MKL MATLAB接口

在將MKL C++代碼做MATLAB接口的過程中遇到一個小問題總是運行出錯,今天終於解決,記錄下來:

mxArray* aa = mxCreateSparse(num_of_feature, model->l, nonzero_element, mxREAL);
ptr = mxGetPr(aa);
jc = mxGetJc(aa);
ir = mxGetIr(aa);

代碼在64位機子上mex後運行會出錯,解決方法:

64-bit mex files using sparse matrices must be rebuilt with the "-largeArrayDims" option.  See the R2006b release
notes for more details.

> mex -largeArrayDims mkl-train.cpp


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章