Main Content

Performance

Troubleshoot code generation issues, improve code execution time, and reduce memory usage of generated code

Some of the most common reasons why GPU Coder™ generated code is not performing as expected are:

  • CUDA®内核不是创建。

  • Host to device and device to host memory transfers (cudaMemcpy) are throttling performance.

  • 没有足够的并行性或设备问题。

These topics elaborate on the common causes for these symptoms and describe how to utilize the built-in screener to detect these issues. You can find information on how to work around for these issues and generate more efficient CUDA code.

Apps

expand all

GPU Coder Generate GPU code fromMATLABcode
GPU Environment Check Verify and set up GPU code generation environment

Functions

expand all

codegen Generate C/C++ code fromMATLABcode
gpucoder OpenGPU Coderapp
gpucoder.profile Create an execution profile report for generated CUDA code
coder.gpu.kernel Pragma that mapsfor-loops to GPU kernels
coder.gpu.kernelfun Pragma that maps function to GPU kernels
coder.gpu.nokernel Pragma to disable kernel creation for loops

Objects

expand all

coder.gpuConfig Configuration parameters forCUDAcode generation fromMATLABcode by usingGPU Coder
coder.CodeConfig Configuration parameters for C/C++ code generation fromMATLABcode
coder.EmbeddedCodeConfig Configuration parameters for C/C++ code generation fromMATLABcode withEmbedded Coder
coder.gpuEnvConfig Create configuration object containing the parameters passed toCoder.CheckgPuinstallfor performing GPU code generation environment checks

Topics