Main Content

실행 속도

생성된 C/C++ 코드의 실행 속도 향상

코드 생성 옵션 및 최적화를 사용하여 생성 코드의 실행 속도를 향상시킵니다. 실행 속도에 영향을 줄 수 있는 동적 메모리 할당을 수정하거나 비활성화할 수 있습니다. parfor 루프를 사용하여 병렬화된 코드를 생성할 수 있습니다. 가능한 경우 기존의 최적화된 C 코드와 특화된 라이브러리를 활용하여 실행 속도를 높입니다.

특정 조건에 맞게 코드를 최적화하는 방법에 대한 자세한 내용은 Optimization Strategies 항목을 참조하십시오.

함수

coder.areUnboundedVariableSizedArraysSupportedCheck if current configuration settings allow unbounded variable-size arrays (R2024a 이후)
coder.cevalCall C/C++ function from generated code
coder.constFold expressions into constants in generated code
coder.inlineControl inlining of current function in generated code
coder.inlineCallInline called function in generated code (R2024a 이후)
coder.loop.interchangeInterchange loop indices in generated code (R2023a 이후)
coder.loop.parallelizeParallelize specific for loops in generated code; disable automatic parallelization (R2021a 이후)
coder.loop.reverseReverse loop iteration order in generated code (R2023a 이후)
coder.loop.tileTile for-loops in the generated code (R2023a 이후)
coder.loop.unrollAndJamUnroll and jam for-loops in the generated code (R2023a 이후)
coder.loop.vectorizeVectorize for loops in generated code (R2023a 이후)
coder.nonInlineCallPrevent inlining of called function in generated code (R2024a 이후)
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration
coder.varsizeDeclare variable-size data
parforParallel for-loop

클래스

coder.BLASCallbackAbstract class for specifying the BLAS library and CBLAS header and data type information for BLAS calls in generated code
coder.LAPACKCallbackAbstract class for specifying the LAPACK library and LAPACKE header file for LAPACK calls in generated code
coder.fftw.StandaloneFFTW3Interface Abstract class for specifying an FFTW library for FFTW calls in generated code
coder.loop.ControlLoop optimization control object (R2023a 이후)

도움말 항목

생성 코드 최적화

memcpy 및 memset 최적화

가변 크기 배열

배열 레이아웃

루프

함수 호출

수치적 경계 조건

외부 코드 통합

문제 해결

Troubleshooting parfor-Loops

Diagnose errors for code generation of parfor-loops.

Resolve Issue: coder.inline("never") and coder.nonInlineCall Do Not Prevent Function Inlining

Troubleshoot instances of coder.inline('never') not preventing inlining.

MEX Generated on macOS Platform Stays Loaded in Memory

Troubleshoot issues that occur when the source MATLAB® code contains global or persistent variables that are reachable from the body of a parfor-loop.