필터 지우기
필터 지우기

timer inside parfor inside mex function

조회 수: 1 (최근 30일)
Rudi Schuech
Rudi Schuech 2016년 3월 24일
답변: Raghu Boggavarapu 2021년 11월 26일
Is there any way to time some code that is inside a parfor that is inside a function I'm trying to convert to mex via the Coder Toolbox?
function [outputs] = to_be_mexed(inputs)
parfor i = 1:100
tic;
hard_stuff;
toc;
end
tic and toc are not supported for code generation (same for clock and seemingly all other built-ins for timing), and, if I use coder.extrinsic, that ordinarily works, but apparently is not allowed within a parfor inside a mex function. Any way to time stuff here? Can be very crude, +/- a few seconds would be more than fine.

답변 (1개)

Raghu Boggavarapu
Raghu Boggavarapu 2021년 11월 26일
As of R2021b MATLAB Coder supports tic/toc for code generation.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by