주요 콘텐츠

Generate GPU code

R2026b

Enable code generation for GPUs

Model Configuration Pane: Code Generation

Description

The Generate GPU code parameter specifies whether to use GPU Coder™ and generate CUDA® code.

Dependencies

  • This parameter requires a GPU Coder license.

  • To enable this parameter, select C++ for the Language and grt.tlc or ert.tlc for System target file.

  • Enabling Generate GPU code selects Support long long and Support long long parameters on the Hardware Implementation pane.

  • For an GRT-based system target file, enabling Generate GPU code changes the following parameters on the Code Generation > Optimization pane:

  • For an ERT-based system target file, enabling Generate GPU code changes the following parameters on the Code Generation > Optimization pane:

  • For an ERT-based system target file, enabling Generate GPU code selects Terminate function required (Embedded Coder) parameter on the Code Generation > Interface pane.

Settings

off (default) | on
Checked box. On

Enables code generation by using GPU Coder.

Unchecked box. Off

Disables code generation by using GPU Coder.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: GenerateGPUCode
Type: character vector
Value: 'CUDA' | 'none'
Default: 'none'

Version History

Introduced in R2020b