Allocate page locked memory for output array in mex?

Hello,
I have something like this:
plhs[0] = mxCreateDoubleMatrix(ref_row, ref_col, mxREAL);
I would like to know if it's possible to replace this function with a cudaHostAlloc function instead. Thanks.

 採用された回答

James Lebak
James Lebak 2012 年 4 月 19 日

0 投票

Justin,
Unfortunately this isn't possible in MATLAB today. The function mxCreateDoubleMatrix returns an mxArray, not a raw pointer, and mxArrays that get returned to MATLAB need to be freed by MATLAB.

3 件のコメント

Justin
Justin 2012 年 4 月 19 日
Thanks for the response!
-Justin
Ander Biguri
Ander Biguri 2019 年 2 月 11 日
Is this still true in 2019?
James Tursa
James Tursa 2019 年 2 月 11 日
MATLAB still needs to allocate its own memory for mxArray variables. Within a mex routine, that means using API functions or call backs into other MATLAB functions.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

質問済み:

2012 年 4 月 19 日

コメント済み:

2019 年 2 月 11 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by