성능
GPU Coder™에서 생성된 코드가 예상대로 작동하지 않는 가장 일반적인 이유 몇 가지는 다음과 같습니다.
CUDA® 커널이 생성되지 않습니다.
호스트에서 장치 메모리로의 전송 또는 장치에서 호스트 메모리로의 전송(
cudaMemcpy
)이 성능 저하를 일으킵니다.병렬 처리가 충분하지 못하거나 장치 문제가 있습니다.
다음 항목에서는 이러한 증상의 일반적인 원인을 자세히 설명하고 내장 스크리너 함수를 활용하여 이러한 문제를 감지하는 방법을 설명합니다. 이러한 문제를 해결하고 보다 효율적인 CUDA 코드를 생성하는 방법에 대한 정보를 확인할 수 있습니다.
앱
함수
객체
도움말 항목
- Code Generation Reports
Create and view reports generated during code generation.
- Trace Between Generated CUDA Code and MATLAB Source Code
Highlight sections of MATLAB® code that runs on the GPU.
- Generating a GPU Code Metrics Report for Code Generated from MATLAB Code
Create and explore GPU static code metrics report.
- GPU Performance Analyzer
Visualize code metrics and identify optimization and tuning opportunities in your code.
- Analyzing Network Performance Using the Deep Learning Dashboard
Investigate the performance of deep learning networks and layers in generated code using the Deep Learning Dashboard. (R2025a 이후)
- Kernel Analysis
Recommendations for generating efficient CUDA kernels.
- Memory Bottleneck Analysis
Reduce memory bottleneck issues when using GPU Coder.
- Optimize Kernels That Contain Loops
Rewrite loops in MATLAB to avoid generated code kernels that contain loops. (R2025a 이후)
- Prevent Kernel Launches Inside Loops
Parallelize loops that launch kernels to execute them on the GPU. (R2025a 이후)
- Minimize Memory Copy Events in Generated Code Loops
Rewrite loops to minimize the number of data transfers between the CPU and GPU in generated CUDA code. (R2025a 이후)