How do I benchmark deep learning code (C/C++/CUDA) to compare performance of the generated code running on CPUs and GPUs?

I'm looking at different deep learning networks (e.g. squeezenet, mobilenet, etc) and I want to be able to profile on different types of hardware (CPU and GPU).
I know I can generate code for these using MATLAB Coder and GPU Coder. I'd like an automated way of benchmarking the code running on different hardware so I can quickly compare performance.

 採用された回答

Bill Chou
Bill Chou 2025 年 11 月 19 日
You can use the dlCodegenBench function to benchmark the runtime performance of deep learning models running as C/C++/CUDA code generated from MATLAB Coder and GPU Coder.
dlCodegenBench automates the execution running with different code generation configurations so you can compare performance on different hardware (CPU/GPU), different deep learning optimization libraries (target-independent code, MKL-DNN, cuDNN, TensorRT, etc).
More details here:

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with GPU Coder についてさらに検索

製品

リリース

R2024a

質問済み:

2025 年 11 月 19 日

編集済み:

2025 年 11 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by