parfor with C++ function call and memory allocation

조회 수: 3 (최근 30일)
Oscar Roberto BLANCO-GARCIA
Oscar Roberto BLANCO-GARCIA 2022년 4월 8일
댓글: Mike Croucher 2022년 4월 8일
Dear all,
I have a function written in C++ that allocates memory depending on the size of the input.
This function was compiled with mex and call from matlab inside a for loop.
When running a large number of iterations the C++ function returns Nan values because of memory corruption.
For a small number of iterations, it just seems to run in separate processors and finish without changing to Nan values.
Are there any recomendations about how to write C++ functions with memory allocation compatible with parfor ?
Best regards,
o
  댓글 수: 1
Mike Croucher
Mike Croucher 2022년 4월 8일
Is it possible to share the code and provide a demo of it going wrong please?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Call C++ from MATLAB에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by