フィルターのクリア

Allocate page locked memory for output array in mex?

1 回表示 (過去 30 日間)
Justin
Justin 2012 年 4 月 19 日
コメント済み: James Tursa 2019 年 2 月 11 日
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 日
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 件のコメント
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 件)

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by