Allocate page locked memory for output array in mex?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Justin
am 19 Apr. 2012
Kommentiert: James Tursa
am 11 Feb. 2019
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.
0 Kommentare
Akzeptierte Antwort
James Lebak
am 19 Apr. 2012
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 Kommentare
James Tursa
am 11 Feb. 2019
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!